2

I am using search to find sites and then sub-sites/webs for a given user. Currently, the search is returning all users personal/My Sites and I don't want these in the results. Is there a way change the search query to exclude "My Sites" in the results? I need a generic solution so I can't add/modify query rules etc. I need it to work out-of-the-box.

I am using REST API and my current query looks like this:

../query?querytext='contentclass:sts_site'&selectproperties='SiteId,Path,Title'&rowlimit=100&trimduplicates=true
3

Try adding NOT Path: http://mysite/* to your query where you use your My Site host address.

1

You can filter them out by using WebTemplate property like this:

(NOT WebTemplate:SPSPERS)

Tested in SP2016.

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.