Forum Discussion

Tamras1972's avatar
Tamras1972
Iron Contributor
Jul 18, 2024
Solved

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)?


4 Replies

  • 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.

     

    • Tamras1972's avatar
      Tamras1972
      Iron Contributor

      Expiscornovus Honestly, I have no idea how to map the crawled properties.  I am following the steps here but a bit lost.
      https://learn.microsoft.com/en-us/sharepoint/manage-search-schema#map-a-crawled-property-to-a-managed-property

      Map a crawled property to a managed property ยป Go to the Search Schema page for a site collection.  I got to step #4 and searched "Status" but no idea which one to select. Will continue reading. Thanks for the tip. 

Resources