Gravatar for

Question by erkany, Apr 1, 2015 10:49 PM

Coveo does not add q parameter to request headers

I have a multilingual site and the search returns same number of results no matter what I enter in the search box. While inspecting I found that the keyword is not in the form data that is posted to /coveo/rest

What could be the reason?

Here is the screenshot from my request:


Gravatar for

Comment by Martin Laporte, Apr 2, 2015 3:29 AM

Hard to say, but I'd guess that somehow the search box is not processed at all by the framework. Does pressing Enter in it trigger a query? This behavior comes from the QueryBox component, and this would tell me whether it's bound to your <input> or not…

Gravatar for

Comment by Jean-François L'Heureux, Apr 2, 2015 9:25 AM

Did you implement your own Search Box component/markup or use the out of the box Coveo for Sitecore component? Did you add any event handler or initialization option to your component?

Gravatar for

Comment by erkany, Apr 2, 2015 1:33 PM

Hi 1- enter key still works 2- we customized the existing searchbox. Here is the init function. I am constructing "@searchpage" variable depending on context language. I add "/nl-BE/" after domain root for example if the site is in Dutch.

Coveo.$(function () {
    Coveo.$('#@Model.SearchBoxUniqueId').coveo('initSearchBox', '@searchPage');
    Coveo.$('#@Model.SearchBoxUniqueId').find("input.CoveoQueryBox").attr("placeholder", '@Model.PlaceholderText');
    Coveo.$('#@Model.SearchBoxUniqueId').find("input.CoveoQueryBox").attr("maxlength", '@Model.MaxCharacters');
Gravatar for

Comment by Jean-François L'Heureux, Apr 2, 2015 1:56 PM

When the user is redirected on the search page after hitting [Enter] or clicking the search button, what is the URL in the browser? Does it contains #q=YourSearchTerms at the end of the URL?

Gravatar for

Comment by erkany, Apr 2, 2015 3:03 PM

Yeap - it does have the q parameter on the URL - not sure why Coveo framework can't get it. Any tips on debugging this?

Gravatar for

Comment by erkany, Apr 2, 2015 4:33 PM

Created a new question for this - but another side issue is: Coveo adds "coveo-executing-query" to the wrapper div of the header searchbox and this class is not removed after query is completed. Resulting in showing a "spinning icon" in place of the "magnifier search button" Any idea?

Gravatar for

Comment by Jeff Hansen, Mar 2, 2016 12:53 PM

Having a similar issue. Any idea what caused this? How did you fix it?

Gravatar for

Comment by Jean-François L'Heureux, Mar 2, 2016 1:16 PM

Similar to the original question @jhansen?

If you have a search page without any search box (registered for that SearchInterface component), the #q hash parameter won't ever be processed because it's the search box job to handle this parameter.

How does your search page is constructed? Do you have a "Coveo Search" component AND a separate "Coveo Search Box" component on your search page?

0 Reply
Ask a question