I am using SharePoint 2016 on-premise.

I want to setup a result source on a site collection to return ONLY the content within this site collection.

I create a new Result Source. Then in the Build Your Query pop up panel the default query string is {searchTerms} which return 0 result in SEARCH RESULT PREVIEW.

Then I input "*" and it returns everything.

Then I input {?{searchTerms} -ContentClass=urn:content-class:SPSPeople} which I copy from other existing result source. It returns 0.

I input {searchTerms} Path:{SiteCollection.URL} again it returns 0.

Could you please advice it is my syntax problem or my farm is configured correctly?

  • How many crawled items you have in your site collection. Maybe for some reason it isn't crawled (you can confirm that from CA search admin by checking the crawl log by url) When you search by "*" it probably returns result from whole content source. – Marek Sarad Jul 11 at 8:17
  • Are you supplying a value for the {searchTerms} value? The initial ? causes the query to look for a value in searchTerms. – Matthew McDermott Jul 11 at 15:22
  • Matthew, you're right. I need to replace {searchTerms} with the actual term. Therefore, input "* Path:{SiteCollection.URL}" in order to make the SEARCH RESULT PREVIEW work. – Mark L Jul 12 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.