Just like the title says, I'm trying to build a search-driven navigation that gets its results (navigation links) from a Search Results Web Part (SRWP). Right now, I'm working on creating the right query: first, I wanted to search based on WebTemplate and ParentLink/ParentWebUrl somehow, where WebTemplate is either a few different types (like STS) or all and some type of information from the parent site to get all the child sites and their child subsites, and so on. Is there a better way to do this?

My query so far:


As you can see, it's very incomplete and while I have the Search Navigation Web Part (SNWP) looking this web part up, it's displaying nothing even though there are results displaying from the SRWP.

Even if it's not an exact solution, but more explanation and guidance on how to accomplish this will be greatly appreciated. Thank you in advance.

1 Answer 1


If you are looking for subsites, you could use contentclass:STS_Web.

If you want to pull site collections, you could use contentclass:STS_Site.

You'd also want to include Path:{Site.URL} to pull subsites from the current site.

The Search Query Tool can be beneficial in helping you craft your search queries, http://sp2013searchtool.codeplex.com. It's been very helpful for me in testing and crafting exactly what I want to display in search results web parts.

  • Thank you so much. Would this be the same for SharePoint Online as well (I'm assuming yes)? When it comes to the Search Navigation Web Part, why is it not picking up these results from the query?
    – LaLaLottie
    May 5, 2016 at 21:00
  • It should work for SPO yes, as for the search navigation web part, I'm not certain. I have yet to use this web part. May 6, 2016 at 13:12
  • I'm trying to get all (child) site collections and subsites under a site collection, my query is this: (Path:https://company.sharepoint.com/sites/dev.my.name/ and contentclass=STS_Site) or (Path:https://company.sharepoint.com/sites/dev.my.name/ and contentclass=STS_Web). No results show up even though I know sites that fall under this. How could I construct a query that gets the right results? And I put this in the Search Results WP.
    – LaLaLottie
    May 6, 2016 at 15:06
  • Try query to (contentclass=STS_Site) or (Path:https://company.sharepoint.com/sites/dev.my.name/ and contentclass=STS_Web) Mar 25, 2017 at 1:41

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.