我有一个索引,该索引具有一个Collection(Edm.String)类型的字段,如下所示,该字段是可工作的且可过滤的。
但是当我对有效负载进行如下查询以进行过滤时:
{
“ count”:是的,
“搜索”:“无法连接到Azure SQL数据库”,
“ searchFields”:“内容,关键字”,
“ select”:“关键字”,
“ facets”:[“源,排序:计数”,“子源,排序:计数”],
“ filter”:“关键字/任何(t:search.in(t,'sql server database')))”,
“顶部”:6
}
我看到这样的结果,其中的关键短语甚至没有完整的值“'sql server database”。为什么会这样呢?筛选器如何对Azure搜索中的集合类型起作用?如何进行精确过滤?
"value": [
{
"@search.score": 0.9469998,
"keyphrases": [
"windows azure",
"sql azure",
"web application",
"database",
"desktop"
]
},
{
"@search.score": 0.7976283,
"keyphrases": [
"Entity Framework Code",
"modelBuilder",
"base tables",
"SQL Azure",
"one-to-one mapping",
"factory",
"pre",
"large numbers of tables",
"partitioned view",
"simple POCO",
"typical partitioning",
"horizontal partitioning strategy",
"CHECK CONSTRAINTs",
"gt",
"EntityName",
"lt",
"ToTable",
"DbContext class",
"UNION",
"project",
"OnModelCreating event",
"foo",
"file groups",
"bar",
"instance",
"peform",
"runtime",
"database",
"Fluent API",
"metadata"
]
},
谢谢。
答案 0 :(得分:1)
search.in
测试字段或集合值是否包含在定界的值列表中(如here所述)。所以这个表达式:
keyphrases/any(t: search.in(t, 'sql server database'))
与此等效(因为空格是search.in
的默认定界符之一):
keyphrases/any(t: t eq 'sql' or t eq 'server' or t eq 'database')
如果您要查找短语“ sql server database”(包括大小写和空格),则过滤器应为:
keyphrases/any(t: t eq 'sql server database')