Forum Discussion

Tamras1972's avatar
Tamras1972
Iron Contributor
Jul 18, 2024

SharePoint Search Query exclude specific pages based on custom field value

In our [site pages] library, we added a [Status] column with values [Current, Archive, Draft].  Essentially, in the search results, I only want site pages that have 'current' status.  Is it possible to do this in Query Builder or other means (i.e. Microsoft Search Verticals)?


  • Tamras1972 you can use for example the ContentType, ContentTypeId or contentclass properties.

     

    Try something like:

    contentclass:STS_ListItem_WebPageLibrary

     

    Did you mapped the crawled property of your custom Status field to a mapped property in the search schema? If that is the case you should also be able to use it in your query builder.

     

Resources