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.

Example

<Mask Name="DocSets" TrimDuplicates="False" EnableStemming="True" Scope="All Sites" Where="ContentTypeId:0x0120D5* AND path:https://macroview365.sharepoint.com/sites/*" >

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;https://macroview365.sharepoint.com/sites/mhmvcm/Test Column 211016/*&quot;"

Related articles

Have more questions? Submit a request

0 Comments

Article is closed for comments.