Gravatar for juanpablo.albuja@verndale.com

Question by jpalbuja, Apr 29, 2019 10:40 PM

Coveo Hive Search Box Suggestions Limit

Hi guys, I have woking my coveo searchbox https://docs.coveo.com/en/2329/coveo-for-sitecore-v5/inserting-and-configuring-a-global-search-box-using-the-coveo-for-sitecore-hive-framework and also I can see suggestions when I strat typing in the search bar.

Is there a way to limit the number of suggestions? How many suggestions is the default limit?

Thanks

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Apr 30, 2019 12:12 PM

Have you tried the numberOfSuggestions option?

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Apr 30, 2019 5:25 PM

I think you can add the numberOfSuggestions option on your SearchBox component.

Here are two options to add data-attributes not fronted in Coveo for Sitecore Hive:

Passing Non-Fronted JavaScript Framework Properties to Hive Components

or

You could add a simple JavaScript snippet that adds the option to your component.

For instance:

document.getElementById("YOUR_SEARCH_BOX_ID").dataset.numberOfSuggestions = 5;

This code can be added in the Custom Initialization Scripts or simply by adding a rendering that contains this code in a script tag.

Ask a question