Home > Microsoft SharePoint, SharePoint 2013 Search, SharePoint2013 > SharePoint 2013: Avoid default results in search result and content search web part with search box

SharePoint 2013: Avoid default results in search result and content search web part with search box

Hi Friends,

I faced one more issue recently related to SharePoint 2013 search, that I thought to share with you.

Scenario:

I have ‘Search Box’ web part and ‘Content Search’ web part on a page, search box is sending query keyword to content search web part to display results. Content search web part has couple of additional queries as following screen shot showing.

Search_Box_1

This query returning the results always and thus showing me the results before even started searching using search box web part, as shown in following image.

Search_Box_2

I wanted content search web part should show the results only when someone searches for it in search box, else results should not be displayed.

Solution:

I have modified the Content Search web part’s query like following, which given the expected results.

Search_Box_3

So after the query changes by default no results are displayed and I am getting results only when I searched using search box web part, as shown in following images.

Search_Box_4

Search_Box_5

The same changes will be applicable if you are using search results web part.

Hope this article will helpful for some of our friends, if any other good alternative for this found please let me also know about it.

Advertisements
  1. Mathias Crochat
    January 22, 2014 at 12:41 pm

    Just i was looking for, thanks guy !

  2. DNelson
    March 18, 2014 at 6:23 pm

    Thanks for sharing this. It works perfectly!!

  3. Nikita
    July 8, 2015 at 9:35 am

    Thanks a lot!

  4. Cyndera
    October 22, 2015 at 4:50 pm

    I know this post is quite old, but I wanted to say thanks anyway because it helped me as well. I am now trying to figure out how to eliminate the generic “Nothing matches your search” message that is still being displayed when a user goes to the page. In case this comment is being read, any help would be greatly appreciated. Thanks!

  5. Thippa
    April 29, 2016 at 3:03 pm

    Thanks very much it saved my time

  6. July 25, 2016 at 9:45 am

    Nice article sir..
    you have save my day..
    Thank You..

  7. Mung
    January 20, 2017 at 9:37 am

    Thanks alot

  1. July 25, 2016 at 5:43 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: