Improve collection matching expressions
Currently, collection matching only supports simple equality for the 'any' option and inequality for the 'all' option.
I would like to be able match a collection against a set of values instead of testing a single match individually and then combining the results as shown below
$filter=tags/any(t: t eq 'x') and tags/any(t: t eq 'y')
Additionally, it would also be useful to have the capabilities to include simple boolean logic within the lambda to craft expressions that match a collection item against slightly more complex logic for example:
$filter=tags/any(t: t eq 'x' or t eq 'y')
We are currently working on expanding the filter syntax available inside lambda expressions (‘any’ and ‘all’). This work is part of the work on Complex Types (currently the highest-voted User Voice item for Azure Search).
Regarding the specific examples in this post, the second example is now possible using the new search.in function. For example, this:$filter=tags/any(t: t eq ‘x’) or tags/any(t: t eq ‘y’)
Can now be written like this:$filter=tags/any(t: search.in(t, ‘x,y’))
In the future we will also be directly supporting ‘or’ inside any/all. We will also support ‘and’ inside any/all for complex types and some primitive types, but not for collections of strings, so the example in the post above using ‘and’ will still be the only way to write that particular query.
The ETA for these filter syntax changes is the same as for Complex Types, since we are delivering them together. See this post for status updates: https://feedback.azure.com/forums/263029-azure-search/suggestions/6670910-modelling-complex-types-in-indexes