0

I wanted to exclude one site-collection from being shown in global search page. I tried excluding the site-collection in central admin but local search was also not working on the site.

In brief: 1. Results from this site should not show in global search 2. Local search on site-collection should work normally

5
  • Use security that is the best approach. Commented Nov 28, 2017 at 2:23
  • I'm not sure if security will help. e.g. same document should be searchable locally but not globally. Since same security policy can't behave differently, thus my argument.
    – vikbehal
    Commented Nov 28, 2017 at 22:12
  • If people have access to the site they can find the document in either location. If they don't they won't find the document. Commented Nov 28, 2017 at 23:57
  • Correct. But the requirement is to trim such results from global results. Any thoughts?
    – vikbehal
    Commented Nov 29, 2017 at 4:03
  • Yes, use security. Commented Nov 30, 2017 at 2:52

1 Answer 1

0

Try the following points:

  1. Go to your search site. Navigate to Site Settings | Query Rules
  2. Within the Query Rules page, select 'Local SharePoint Results' for the context and then click 'New Query Rule'
  3. Within the New Query Rule dialogue, provide a title for the rule, e.g. 'Remove Site X from results'
  4. Ignore the query conditions - you want it to fire for all queries
  5. In the Actions section, click the link 'Change ranked results by changing the query'
  6. Within the 'Build your query' dialogue, in the Property Filter dropdown box, select 'Path'. For the parameter, change it from the default 'contains' to 'Not starts with'. For the value, select 'Manual value' and then type the URL for the site you want to exclude. Then click the button 'Add property filter'
  7. You should see the Query text display something like {searchTerms} -Path=https://site/sub-site* displaying your site hierarchy up to the point that you want excluded. This is telling to the search engine to filter out all results that begin with that path. Note: this will also exclude any further sites beneath that URL enter image description here
1
  • Thanks Jerry. I had tried this approach but it didn't work. Is it working at your end?
    – vikbehal
    Commented Nov 28, 2017 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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