I have a Search Box web part configured for an internet search, set to output to an associated Search Results webpart, but when the page first loads the Search Results webpart throws an error.

error image

If I enter a search query and hit enter everything then goes back to normal and the search works fine.

enter image description here

Does anyone know what might be causing the initial webpart to show an error when the page loads?

This is SharePoint Online.

Edit: Additional screenshot of Search Results webpart enter image description here

  • What is the Result Source query? – Matthew McDermott Dec 7 '17 at 2:08
  • @MatthewMcDermott Query set up in the result source is <bing.com/search?q={searchTerms}&format=rss&Market=en-au> – Nathan R Dec 7 '17 at 3:09

It looks like you are not accounting for the possibility that the query is empty. When Bing receives an empty {searchTerms} string the query fails and throws that error.

| improve this answer | |
  • Thanks, that makes sense. Do you have any pointers on where I can account for this? Would it be done in the query itself? Or is it possible I can just configure a default value in the search on page load? – Nathan R Dec 7 '17 at 23:07
  • As far as I know, you can't do it on the Result Source. Best bet would be to configure a default query. – Matthew McDermott Dec 8 '17 at 12:48
  • You were correct with it not handling an empty query. I managed to resolve the issue by changing the query test in the search results web part to \\{searchTerms?}. Now it just returns an empty result search rather than the error. – Nathan R Dec 13 '17 at 23:14

Is this happening on a custom search center results page created by you or on default osssearchresultes page? If on a custom search center results page, do you have any customization on your search results webpart? If so check on the customization or post the details of what has been customized. If it is happening on default osssearchresults page raise a support ticket with Microsoft

| improve this answer | |
  • The results are displayed on the home.aspx page, I'm not sending the results to a separate search results page. – Nathan R Dec 7 '17 at 3:13
  • Does that mean you have a custom results webpart on your home page? do you have any properties set on the results webpart? – Naveen Gabriel Dec 7 '17 at 3:20
  • yes I have added a results webpart to the homepage, it is just about completely OOB though. I've added a screenshot of the webpart query to the original post. – Nathan R Dec 7 '17 at 4:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.