Gravatar for svb@nemetos.net

Question by sergiubretan, Jul 18, 2018 1:23 PM

SXA Global SearchBox not working

I am using sitecore 9 with Coveo SXA for sitecore .If i put a global search box inside an external component on my homepage it does the redirect to my search page but it's not doing the search.If I put a search box (not global) on search page it's working but i don't want to have the search box on search result page.Can anybody help me?

Thanks

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Jul 18, 2018 1:44 PM

You must configure the Data Source used by the Global Search Box component so that the "Search Page Uri" is set.

The field is required for this component.

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jul 18, 2018 2:27 PM

With the Coveo JavaScript Search Framework, UI components are responsible to read the state in the URL and inject the right information in the queries built and sent to the Coveo Search API.

For the query part of the URL (`q`), it is the responsibility of the Searchbox component. Without a Searchbox, or an Omnibox component, the query is never extracted from the state to be used in the search interface queries.

If you do not want a search box in your search interface (which I find a weird requirement, how does the user will change its query if he did a typo or change his mind), you could wrap the component in a DOM element with `display:none` CSS for it not to be displayed to the user.

Ask a question