There are currently no text matching features available for CosmosDB. However, I was able to implement a wildcard search function using UDF (User Defined Function), which uses the Javascript match () function:
function userDefinedFunction(input, pattern) { return input.match(pattern) !== null; };
Then you will need to write your query as SQL and use the UDF that you defined (in the example below, it is assumed that you called the REGEX function
SELECT * FROM c where(udf.REGEX(c.name[0]._value, '.*Jr.*') and c.label='person')
Performance will be far from ideal, so you need to decide whether the solution is acceptable or not, based on your latent and cost prospects.
Alexdrenea
source share