I've created a search query to get all SharePoint Sites where I have access to. This was made with the results webpart and a search query. When I'm trying to search in this list the results won't be reduced. With managed properties in the search box for example title:Testsite everything works fine. Maybe someone has an idea how to fix it.

  • 1
    Can you clarify your question? What is your query? Are you searching for Sites or items in a list of sites? Which version of SharePoint? – Matthew McDermott Nov 4 '16 at 11:43
  • Hi. The query is {searchboxquery} contentclass=STS_Web contentclass=STS_Site EGGPBSiteType=Project -Path:sp.egger.com/templates EGGPBProjectStatus<>Closed The EGGPBSiteType and EGGPBProject Status are custom managed properties. With this Query I'm getting all our active project sites. If somebody is searching for a bracket of a name e.g. test the search results without doing with a managed property e.g. "Title:test" the search results webpart also displays all results like before. In some cases I saw that the results were reduced by 1 item. – Michael Mayr Nov 8 '16 at 13:34
  • you are missing * in your query, and use {searchTerm}* instead of {searchboxquery} – YogaPanda Nov 8 '16 at 20:38

It should be

{searchTerm}* (contentclass=STS_Web contentclass:STS_Site EGGPBSiteType=Project -Path:"http://sp.egger.com/templates" EGGPBProjectStatus<>Closed)

Make sure you have quotes around the URL and managed properties are correct. The first answer has a good point that you don't need the contentclass because your custom properties are very specific.

  • 1
    Thank you for your answer. I changed the query and removed STS_Site, STS_Web and Path and everything worked. The main problem is that I implemented a sorting at the search results webpart without the "Relevance" sorting. Without this the search results won't be changed if somebody is searching a site. The main request was to filter the search results which were provided by the above mentioned query but this is only possible with refinements (cause I haven't found any other solution). – Michael Mayr Nov 9 '16 at 14:12

You may want to try removing the Site Collection from your query. More than likely you can also remove the Web too since you are using the very specific EGGPBSiteType=Project.

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.