按任意多个字符串查询/筛选Azure Search Edm.Collection

按任意多个字符串查询/筛选Azure Search Edm.Collection,azure,lambda,azure-cognitive-search,azure-search-.net-sdk,Azure,Lambda,Azure Cognitive Search,Azure Search .net Sdk,我正在尝试筛选azure search edm.collection,以在集合中有多个字符串时返回结果。我只能在查询一个项目时让它工作,这对于我的用例来说不够好。我找不到查询多个参数的语法 filter += "FirmTypes / any (x: x eq 'Big 4')"; 以上操作将返回公司类型为big4的所有文档 我尝试了多种方法(下面有些)来过滤多个参数,但都没有成功 //filter += " OR any (x: x eq 'Industry')"; //filter +=

我正在尝试筛选azure search edm.collection,以在集合中有多个字符串时返回结果。我只能在查询一个项目时让它工作,这对于我的用例来说不够好。我找不到查询多个参数的语法

filter += "FirmTypes / any (x: x eq 'Big 4')";
以上操作将返回公司类型为big4的所有文档

我尝试了多种方法(下面有些)来过滤多个参数,但都没有成功

//filter += " OR any (x: x eq 'Industry')";
//filter += "FirmTypes / any (x: x eq 'Industry')";
//filter += "FirmTypes / any (x: x eq 'Big 4', 'Industry', 'PLC')"
//filter += "FirmTypes / any (x: x eq 'Big 4' or 'Industry' or 'PLC')"
//filter += "FirmTypes / any (x: x eq 'Big 4') or (x: x eq 'Industry')"
//filter += "FirmTypes / any (x: x eq 'Big 4')|(x: x eq 'Industry')"

有谁能帮我指出正确的方向吗?提前谢谢。

我一发帖就收到了。如果其他人也有同样的问题

"FirmTypes / any (x: x eq 'Big 4') or FirmTypes / any (x: x eq 'Industry')"

我一发帖就收到了。如果其他人也有同样的问题

"FirmTypes / any (x: x eq 'Big 4') or FirmTypes / any (x: x eq 'Industry')"

筛选多个值的最佳方法是使用新的
搜索。在
功能中:

FirmTypes/any(x: search.in(x, 'Big 4|Industry', '|'))

对于大量的值,
中搜索.in比使用
eq
的组合要快得多,而且它可以处理更多的值,而不会达到过滤器复杂性的硬限制。

对多个值进行过滤的最佳方法是使用新的
搜索。在
功能中:

FirmTypes/any(x: search.in(x, 'Big 4|Industry', '|'))

对于大量的值,
search.in
比使用
eq
的组合要快得多,而且它可以处理大量的值,而不会达到过滤器复杂性的严格限制。

太好了,谢谢。我读过msdn上的search.in语法,但不知道它是在any表达式中使用的,所以我的版本不起作用。感谢您抽出时间回答。太好了,谢谢。我读过msdn上的search.in语法,但不知道它是在any表达式中使用的,所以我的版本不起作用。感谢您抽出时间回答。