繁体   English   中英

优化搜索结果

[英]Refine search results

我正在使用SharePoint其余搜索API。

我要它返回给我一组特定的结果。

当前,它在名为myfield的字段中搜索。 myfield是一个多选字段。 我正在搜索以返回myfield等于a的结果。 如果包含(myfield = a; b; c)并且仅等于(myfield = a),则返回结果。

但是,我希望它返回仅等于a的结果。 因此,如果返回等于a的结果,则不返回结果,也返回其他结果。

我当前使用的查询是:

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'

我试图选择优化过滤器无济于事:

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/zh-CN/library/office/ee558911.aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM