细化搜索结果
Refine search results
我正在使用 SharePoint 休息搜索 API。
我要求它 return 给我一组特定的结果。
它目前正在搜索名为 myfield 的字段。 myfield 是一个多项选择字段。我正在搜索 myfield 等于 a 的 return 个结果。如果它包含一个 (myfield = a;b;c) 并且它只等于一个 (myfield = a),那么它 return 就是一个结果。
但是,我希望它 return 结果只等于一个。所以如果它等于 a,则不要 return 结果,但也可以是其他结果。
我目前使用的查询是:
http://testurl.com/Sites/mysite/_api/search/query?querytext='(Country:FRA)(ContentType:mycontenttype)(myfield:a)'&rowlimit=50&SelectProperties='Title,LastModifiedTime,myfield'&trimduplicates=false&sortlist='LastModifiedTime:descending'
我已经尝试 select 细化过滤器无济于事:
http://testurl.com/Sites/mysite/_api/search/query?querytext='(Country:FRA)(ContentType:mycontenttype)(myfield:a)'&rowlimit=50&SelectProperties='Title,LastModifiedTime,myfield'&trimduplicates=false&sortlist='LastModifiedTime:descending'&refinementfilters='myfield:equals("AMER")'
您尝试过使用 KQL 吗?似乎您可以使用“=”操作而不是“:”。
":"
Returns results where the value specified in the property restriction is equal to the property value that is stored in the Property Store database, or matches individual terms in the property value that is stored in the full-text index.
"="
Returns search results where the property value is equal to the value specified in the property restriction.
Note
We do not recommend combining the = operator together with asterisk (*) when you do exact matching.
https://msdn.microsoft.com/en-us/library/office/ee558911.aspx
我正在使用 SharePoint 休息搜索 API。
我要求它 return 给我一组特定的结果。
它目前正在搜索名为 myfield 的字段。 myfield 是一个多项选择字段。我正在搜索 myfield 等于 a 的 return 个结果。如果它包含一个 (myfield = a;b;c) 并且它只等于一个 (myfield = a),那么它 return 就是一个结果。
但是,我希望它 return 结果只等于一个。所以如果它等于 a,则不要 return 结果,但也可以是其他结果。
我目前使用的查询是:
http://testurl.com/Sites/mysite/_api/search/query?querytext='(Country:FRA)(ContentType:mycontenttype)(myfield:a)'&rowlimit=50&SelectProperties='Title,LastModifiedTime,myfield'&trimduplicates=false&sortlist='LastModifiedTime:descending'
我已经尝试 select 细化过滤器无济于事:
http://testurl.com/Sites/mysite/_api/search/query?querytext='(Country:FRA)(ContentType:mycontenttype)(myfield:a)'&rowlimit=50&SelectProperties='Title,LastModifiedTime,myfield'&trimduplicates=false&sortlist='LastModifiedTime:descending'&refinementfilters='myfield:equals("AMER")'
您尝试过使用 KQL 吗?似乎您可以使用“=”操作而不是“:”。
":"
Returns results where the value specified in the property restriction is equal to the property value that is stored in the Property Store database, or matches individual terms in the property value that is stored in the full-text index.
"="
Returns search results where the property value is equal to the value specified in the property restriction.
Note
We do not recommend combining the = operator together with asterisk (*) when you do exact matching.
https://msdn.microsoft.com/en-us/library/office/ee558911.aspx