2

I've seen a number of explanations for how this works in SharePoint 2013 but nothing specific to SharePoint 365.

I've got 2 separate folders within my document library, one of which contains draft documents and the other contains final documents. These documents (of which there are hundreds) are duplicated from the draft to the final submission (with various minor changes made within them) and so have the same names.

The issue is, when searching for e.g. "Health and Safety Report" the results show both the draft and the final documents. The client has requested that only the final documents show in the results. We still need the draft documents available in the library if needed, so can't remove them.

There are many other folders within the document library which need to still show in the search results and so I need to be able to exclude the draft documents folder specifically.

2 Answers 2

1

You can use advanced search to add a "Does not contain" rule to exclude results based on a specific url path. This adds a querystring parameter that "negates" that path from existing on a specific property, such as:

http://url/search/Pages/results.aspx?k=-SPSiteUrl%3A"mylibrary/health & safety/drafts"

Notice the negative sign in front of SPSiteUrl.

This can be applied "by default" using the Search webpart configuration. Edit the page where your search results are displayed and edit the Search Results webpart. Then use the "Change Query" option to configure it as needed similar to above.

1

Here are a couple ideas.

  1. Don't duplicate the documents, that's how we used to do it in a file share. Since 2003 SharePoint has had the ability to create draft unpublished documents. Then when you are ready to "Publish" them you Publish a Major version. Then the documents are available to users and the Search Crawler. Prior to publication they are only available to Authors.

  2. Turn off the indexing for the library. In the library Advanced settings un-select "Allow items from this document library to appear in search results?"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.