SP2013: Advanced Search web part returns 0 results
-
28-09-2020 - |
Question
I am migrating a site collection from SP2010 to SP2013. I need to maintain the search behavior so that I do not use search center approach.
I created a new page results.aspx
and add two OOB webparts "search results" and "refinement". It works as expected.
SP2013 does not provide OOB advanced search webpart for some reason. Hence I create a search center, export the advanced search webpart and then import to a new page advanced.aspx
. It looks fine.
However, when I key in a search value in the advanced.aspx
page, it redirects back to results page as expected. The URL is like /SitePages/results.aspx?k=ALL(keyword)
. Whatever keyword I used, the advanced webpart just does not work. But the basic search webpart works fine.
Any idea? Thanks.
Solution
I am sorry I just got the answer. It is because I edited the search query on results.aspx. The original query is:
{searchboxquery}
I changed to:
{?{searchboxquery}}
It will avoid result.aspx return wildcard result when type in nothing (i.e. /sitespages/results.aspx?k= will return all items within the search result source)
After I remove the questionmark the Advanced search is working now.
Now I have another question... how can I make /sitespages/results.aspx?k= return nothing?