Gravatar for emil.christiansen@kraftvaerk.com

Question by emil_christiansen, Jun 28, 2016 7:18 AM

Coveo For Sitecore - Omnibox Result List - Facet list

Hi there!

We have a 'search view' where we have added a 'facet'-component and 'omnibox result list'-component as well.

In the facet-component we have enabled "include facet values in the omnibox".

The functionality seems to be working, but instead of searching on the facet-names, we want to do an actual search and present the facets and number of search results on each of them.

E.g.

I have three facets: 'fruit' , 'meat' and 'bread'

In the search field, i type in "steak" and the facet 'meat' is shown below with a (3) telling me that there are 3 search results matching "steak" on the facet 'meat'.

Does any of you know how to achieve that functionality?

We are using the Coveo For Sitecore Free Edition.

Thanks In Advance!

1 Reply
Gravatar for slangevin@coveo.com

Answer by Simon, Jun 30, 2016 6:04 PM

I do not see an out of the box component doing exactly what you are looking for, but do not despair!

The facet count is produced with a Group By call to the REST API. The Group By call will take a queryoverride parameter, which is the term entered in your search box:

https://developers.coveo.com/display/public/SearchREST/Group+By+Parameters

You can include this Group By in a custom PopulateOmnibox function:

https://developers.coveo.com/display/public/JsSearchV1/Providing+Suggestions+for+the+Omnibox

And it should do the trick.

Cheers,
Simon

Ask a question