none
SharePoint 2013 REST Api - refinementfilters "Containts" OR "SubstrinOf" operator RRS feed

  • Question

  • Hi, I am building SharePoint 2013 REST API for Search and I need to query on refinementfilters with a specific string, whether a specific refiner contains a specific string.

    How to use substringOf or Contains in refinementfilters ?

    Thanks in advance.

    Wednesday, January 8, 2014 5:33 AM

All replies

  • Hi,

    According to your post, my understanding is that you wanted to query on refinementfilters with a specific string.

    You can use the SharePoint 2013 Search Query Tool, it provides some samples about the refinementfilters.

    http://sp2013searchtool.codeplex.com/

    The sample like refinementfilters =substringof(‘urn’, Name).

    The following articles contain some Filter Expressions for your reference.

    http://www.odata.org/documentation/uri-conventions/

    http://msdn.microsoft.com/en-us/library/hh169248(v=nav.71).aspx

    Thanks & Regards,

    Jason

    Jason Guo
    TechNet Community Support

    Thursday, January 9, 2014 9:57 AM
  • Thanks Jason.

    With rest api on lists it works, but with search rest api on refinement filters it shows "The query string "refinementFilters" is missing or invalid."

    Can you make necessary changes in my below example? (this isn't working) Am I missing something?

    http://SERVERNAME:PORT/_api/search/query?querytext='sharepoint'&refiners='Technology'&refinementfilters='substringof("micro",Technology)'

    Thanks.


    • Edited by Synoverge Friday, January 10, 2014 8:52 AM
    Friday, January 10, 2014 8:52 AM
  • Anyone have any idea?

    Thanks.

    Wednesday, January 22, 2014 11:56 AM
  • I think I had similar requirements.

    I needed to refine based on the content type having a specific substring. We had content types for 'ReportLevel1', 'ReportLevel2' and I needed all reports.  I solved it using an * for wildcard:

    http://SERVERNAME:PORT/_api/search/query?querytext='report'&refinementfilters='SPContentType:("Report*")'

    Hope this helps?

    Wednesday, February 26, 2014 5:44 PM
  • The refinementfilters that uses substringof doesnt work for me.

    I tried this $refinementfilters=substringof('A',Title)

    This should return all items that has a letter A in the Title column right?

    Wednesday, October 21, 2015 1:57 AM
  • For Getting contains in refinement filters ,just use

    refinementfilters='Title:("micro*")'

    use full colon followed by the text plus '*' inside quotes and bracket.

    this will return all items with Title starting with 'micro'.


    • Edited by Hari nvp Thursday, April 21, 2016 12:21 PM
    • Proposed as answer by Hari nvp Friday, May 13, 2016 8:41 AM
    Thursday, April 21, 2016 12:12 PM