Limit the Scope of your Result Sources

I struggled with what to title this post. I run across this all the time when evaluating “OPW” (Other People’s Work). If you navigate to a search results page that does not have a query defined and you see a whole bunch of “Default Results” then you know what I am talking about.

The Problem

This is what I mean. In the picture below I am on my “Customer” search page and I have not entered a search term, yet I still get results. My page is using a Result Source that is defined as: {searchTerms} BCSEntityName:DHTCustomer Which applies the search box term and adds the additional filter for my Customer entities from BCS.

Default results with no query


Above I used 59 words to attempt to describe a problem that has the shortest of solutions. You think that the problem lies somewhere in your search page, but it actually resides on the Result Source. If you change your Result Source to use the following notation you will get the desired result.

{?{searchTerms} BCSEntityName:DHTCustomer}

No Search Term, No Query.

No query, no results

|| Building Blocks || Search || SharePoint 2013

comments powered by Disqus

Let's Get In Touch!

Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!