21

I am trying to add an "Advanced Search" web-part to my web-part page. Currently the web part is raising an error object reference is not set to instance of object.

Full stack trace recovered from SharePoint log is shown below:

AdvancedSearchBox class encountered unexpected error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.GetScopeEnumerator(ScopeInformation & defaultScope)
at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateScopeRows(Table parentTable)
at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateScopingSectionChildControls(Table parentTable)
at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateChildControls(). 813aaaa7-5645-43b5-85ba-e8c67a57997b 03/07/2014 05:40:27.31 w3wp.exe (0x10D8) 0x0BEC SharePoint Server Search Query
dmz8 Unexpected AdvancedSearchBox class encountered unexpected error: System.EventArgs. 813aaaa7-5645-43b5-85ba-e8c67a57997b

Can anyone provide guidance on what I am doing wrong?

Marcelo Espinosa
  • 474
  • 1
  • 6
  • 20
Jon
  • 567
  • 2
  • 11
  • 20

1 Answers1

1

It looks like search may not properly be setup on your farm. My first recommendation would be to verify that search works. The easiest way, in my opinion to verify search is to add the search results webpart to a page and verify that I can pass in the search query string to get results.

www.myspsite.com/pages/SearchPageWithResultsWP.aspx?k=SearchTermIKnowShouldWork

Beyond that, I can't help you too much as we have scripts that setup our search automagically.

Edit: The correct way to pass a search string and get good results in SP is not with a ?, but with a #. Also, there is an out of the box way to double-check search. So, to completely test OotB functionality of search, your url would look something like this:

https://my.site/_layouts/15/OSSSearchResults.aspx#SearchTermIKnowShouldWork