0

In SharePoint 2013 on premise, I have a search page with a search box where it is possible to search for items of a specific content type under a specific site. This works as expected.

path:"http://path1" ContentTypeId:0x0100XXX*

But, if I also add path2 as the other site that I also would like to query for those content types, I get the strangest results.

(path:"http://path1" OR path:"http://path2") ContentTypeId:0x0100XXX*

Everything seems alright until I enter a search word in the search box. If I search for a word that I know does not exist in one of the sites, the search results bring up all the items with the content type under that site and for the other site it highlights the words in the items where there is a match.

I can also mention that this search page is configured to display all items of this specific content type when no search word is entered in the search box.

I suspect it is some kind of problem with the syntax I use in the query builder, but I have tried several variants without success. But the strange part is that the error only can be seen when a search word is entered in the search box.

2
  • Did you try ((path:"path1" OR path:"path2") AND ContentTypeId:0x0100XXX*)
    – Unnie
    Commented Sep 15, 2016 at 12:14
  • Yes, it was giving the same result.
    – Gunilla
    Commented Sep 15, 2016 at 12:34

1 Answer 1

0

It seems for some reason that the search has been working properly without the {SearchBoxQuery} part when I just was searching one site. When I changed my query to

{SearchBoxQuery} (path:"http://path1" OR path:"http://path2") ContentTypeId:0x0100XXX*

the search results are working properly when searching multiple sites.

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.