Tuesday, January 27, 2015


In last post we saw how to use SharePoint Search refiners in REST services. Refiners are very helpful to slice the results and remove irrelevant results. To get more relevant and correct results of search you need to apply multiple refiners. So let's see how you can create query for multiple refiners in REST  service.

In last post we saw an example to refine result on one refine. To make it work for multiple refiner you need to construct query like:

/_api/search/query?querytext='yammer'&refiners='Write,DisplayAuthor,ContentType,FileExtension,FileType'&refinementfilters='and(Write:range(" + frmDISO + "," + toDISO + "),DisplayAuthor:equals(\"" + authorFilter + "\"))'

Pass this query to SharePoint  Search REST and get more relevant results. In above query you can see we have applied two refiners of ‘Write’ and ‘DisplayAuthor’ at a time. And the result will be filtered on the ‘Write’ and ‘DisplayAuthor’.

Happy SharePoint coding.

0 comments:

Post a Comment