How to restrict Videos in the Classic Search Webpart

SR VSP 1,251 Reputation points
2023-06-21T17:46:58.3266667+00:00

Guys,

Is there any way to restrict the Search of "Videos" file names containing a certain keyword Ex: Privacy.mp4, ? in the Classic Search center

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,666 Reputation points Microsoft External Staff
    2023-06-22T06:38:43.4933333+00:00

    Hi @SR VSP ,

    Yes, it is possible to make "Video" filenames containing specific keywords not searchable in SharePoint's Classic Search Web Part. One way to do this is to use the search schema to create a managed property for the "Video" file type and then exclude the managed property from the search results.

    Here are the steps to create a managed property and exclude it from search results:

    1. Go to the SharePoint admin center and select the search service application.
    2. Click on "Search schema" and then "New Managed Property".
    3. Name the managed property (e.g., "VideoFileName") and set the type to "Text".
    4. Add a mapping to the crawled property that contains the "Video" file name.
    5. Save the managed property and wait for the search crawl to complete.
    6. Go to the search results page and click on "Edit Page".
    7. Click on the Classic Search Web Part and then "Edit Web Part".
    8. In the "Properties" pane, expand the "Query" section.
    9. In the "Exclude" field, enter the managed property name (e.g., "VideoFileName").
    10. Save the changes to the web part.

    This will exclude any "Video" filenames containing the specific keywords from appearing in the search results.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.