Gravatar for poonam.saini@abc.virginia.gov

Question by poonam333, Jan 10, 2019 8:45 PM

Field Suggestion in Coveo Searchbox - Hive

I want that when a user is entering letters in the coveo search box then the user is presented with options matching it in dropbox . How can this be implemented in Coveo Hive?

1 Reply
Gravatar for amoreau@coveo.com

Answer by amoreau, Jan 10, 2019 8:55 PM

Have you looked at this page? https://docs.coveo.com/en/340/javascript-search-framework/providing-query-suggestions

It describes the best way to provide query suggestions. It is usually recommended to let Coveo ML Query Suggest understand what people are searching for than to use field query suggestions. although there are legitimate use cases for field query suggestions.

Let me know if this page helped!

-Alex

Gravatar for poonam.saini@abc.virginia.gov

Comment by poonam333, Jan 11, 2019 2:30 PM

@amoreau

Alex,

That page did help me to get the field suggestions. I modified my searchbox and included following options:

<div id="@Model.Id" class="CoveoSearchbox" data-enable-omnibox="true" >
<div class="CoveoFieldSuggestions" data-field="@title"></div>

Now as soon as I enter first letter in the searchbox , I get suggestions in drop down. But those suggestions disappear with 2nd letter and they don't come back until the complete word matches. For Ex. For Amaretto, on entering A, the suggestions show up but then start showing error on 2nd letter onward until full word match , when the suggestions come back again. Please refer the attached picture.

I would like the suggestions to keep coming as long we have partial match as here https://www.abc.virginia.gov/products/recipes/all-recipes#/search (We modified the auto suggest to send query at 1st letter and then on three letters entry thereafter to avoid sending so many queries to Coveo)

field-suggestions.png

Ask a question