microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
388 stars 341 forks source link

Customizing Search Results Webpart to Filter Based on Document Metadata Tags #3988

Closed Tishaay closed 2 months ago

Tishaay commented 2 months ago

I am in the process of customizing the Search Results Webpart on one of our SharePoint sites to improve the accuracy of search outcomes. Our document library is structured with metadata tags, and we want to configure the search functionality to display only documents or files tagged with the relevant categories when users input keywords in the search box. In cases where the entered keywords do not align with these categories (e.g., document content such as ingredients or other non-tagged metadata), we would prefer the search to return no results, ensuring that only the most relevant, tagged documents are shown.

To achieve this, I attempted to add new managed properties to the search collection. However, when trying to select those properties in the Search Results Webpart configuration, I noticed that the search schema changes were not reflected.

Could you advise if it is possible to filter the webpart results strictly based on this condition, and what steps may be necessary to resolve the issue with the search schema not updating?