Error box when going to a search subsite page with Sharepoint Online

Ingermann, Erik 21 Reputation points

I have created a search subsite, and I am getting an error when first going to the page, this is before anything is typed into the search box. It seems like the search is run immediately upon going to the page and then being overwhelmed by the results from searching a blank entry.

If you type into the box, once the error is there, it searches just fine with no error. The problem is that users that go to the site and see an error box which is confusing.

I was trying to find a way that the search would not start until something was entered in the search box, but I am not finding anything. I have searched for the error message but not finding anything.

Does anyone have any ideas?



SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
1,797 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ChelseaWu-MSFT 6,266 Reputation points

    Hi Erik, thanks for posting in the Q&A forum.
    Did you build the search subsite/page using Search Box Web Part and Search Results Web Part? If that is the case, please check as following:

    1. If you are using the default settings, the web parts will display as the image below (no results found): 71386-screenshot-2021-02-24-105629.png You can remove or modify the Query/Query text by editing the web part and then click “Change Query”. 71335-screenshot-2021-02-24-105516.png Reference: Change settings for the Search Results Web Part.
      1. If you need to use custom Query (text) for the web part, the Search Results Web Part will return all results before the query text is typed, which is the expected behavior.
        In this scenario, I would suggest you build a search center instead. Create a new site/subsite using the Enterprise Search Center template, and the search center will show the Search Box only every time it is entered.
      71396-screenshot-2021-02-24-110814.png References: Manage the Search Center in SharePoint. / Create a classic site.

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    **Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **

    1 person found this answer helpful.

  2. sadomovalex 3,601 Reputation points

    does it work when you have just created Search center and added web part there without custom queries? If it works this way then problem may be related with queries. Try to create empty search center and go step by step doing the same things which you did last time and after each step test whether it works or not. If after some step it will start showing the same error then it is caused by last step.

    1 person found this answer helpful.