简体   繁体   English

优化搜索结果

[英]Refine search results

I am using SharePoint rest search API. 我正在使用SharePoint其余搜索API。

I am asking it to return me a specific set of results. 我要它返回给我一组特定的结果。

It currently searches against a field called myfield. 当前,它在名为myfield的字段中搜索。 myfield is a multiple choice field. myfield是一个多选字段。 I am searching to return results where myfield equals a. 我正在搜索以返回myfield等于a的结果。 It returns a result if it contains a (myfield = a;b;c) and if it equals only a (myfield = a). 如果包含(myfield = a; b; c)并且仅等于(myfield = a),则返回结果。

However, I want it to return results where it equals only a. 但是,我希望它返回仅等于a的结果。 So not to return results if it equals a, but also others. 因此,如果返回等于a的结果,则不返回结果,也返回其他结果。

The query I am currently using is: 我当前使用的查询是:

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'

I have tried to select refinement filters to no avail: 我试图选择优化过滤器无济于事:

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")'

Have you tried using KQL? 您是否尝试过使用KQL? It seems as if you can use the "=" opeartion instead of ":". 似乎可以使用“ =”代替“:”。

":"
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 https://msdn.microsoft.com/zh-CN/library/office/ee558911.aspx

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

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