Limiting results using "WHERE" in search masks

One way of limiting search results for a mask is to use the Where attribute. This takes any valid KQL query and works for both SharePoint On-Premise and Online.


<Mask Name="DocSets" TrimDuplicates="False" EnableStemming="True" Scope="All Sites" Where="ContentTypeId:0x0120D5* AND path:*" >

This will restrict results to document sets located beneath the specified path.

Notes on usage:

  • AND and other operators need to be in upper case
  • Operators are case sensitive so Where must be in mixed case
  • Escape out characters like quotation marks in the usual way
    I.E. use &quot; when you want a " (quote) passed through.
    For example:
    Where="path:&quot; Column 211016/*&quot;"

Related articles

Have more questions? Submit a request


Article is closed for comments.