Gravatar for jonathan.queiroz@nexio.com

Question by jonathan.queiroz, May 7, 2019 4:27 PM

How can I make sure facet will be displayed only in the context language?

Hello,

I created a couple facets, one for profile and one for content type.

Facets look correct until I use search box to enter a keyword. When this happens facets are displayed in both languages.

On the top of that, when I click on the facet item that does not match the current language, result list has no items.

What are we missing here?

Thanks in advance,

Jonathan

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, May 7, 2019 4:40 PM

Could you add the search query network request values for the `q`, `aq`, `cq`, and `groupBy` parameters? Both for the query without a facet selection and for the query with a selection that leads to no results?
Thanks!

Gravatar for jonathan.queiroz@nexio.com

Comment by jonathan.queiroz, May 7, 2019 5:18 PM

For now we just have...

"#sort=relevancy" when the page loads

"#q=test&sort=relevancy" when we add a keyword in the search box

"#q=test&sort=relevancy&f:type=[News]" when we have a keyword and facet item selected (we have results, facet value in the same context language)

"#q=test&sort=relevancy&f:type=[Nouvelles]" when we have a keyword and facet item selected (we have no results, facet value is not in same the context language)

Thanks

Gravatar for jonathan.queiroz@nexio.com

Comment by jonathan.queiroz, May 8, 2019 6:59 PM

For the search box...

q: test

aq: (NOT @z95xtemplate==(ADB6CA4F03EF4F47B9AC9CE2BA53FF97,FE5DD82648C6436DB87A7C4210C7413B)) (@source=="ABC_index - ABC-dev")

cq: (@z95xlanguage==en) (@z95xlatestversion==1)

groupBy: [{"field":"@profile","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":[],"queryOverride":"test"},{"field":"@contenttypes","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":[],"queryOverride":"test"}]

Gravatar for jonathan.queiroz@nexio.com

Comment by jonathan.queiroz, May 8, 2019 7:06 PM

For the facet selection that leads to no results...

q: test

aq: (NOT @z95xtemplate==(ADB6CA4F03EF4F47B9AC9CE2BA53FF97,FE5DD82648C6436DB87A7C4210C7413B)) (@contenttypes==Nouvelles) (@source=="ABC_index - ABC-dev")

cq: (@z95xlanguage==en) (@z95xlatestversion==1)

groupBy: [{"field":"@profile","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":[],"queryOverride":"test"},{"field":"@contenttypes","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":["Collective Agreement","Conventions Collectives","News","Nouvelles"],"queryOverride":"test","advancedQueryOverride":"(NOT @z95xtemplate==(ADB6CA4F03EF4F47B9AC9CE2BA53FF97,FE5DD82648C6436DB87A7C4210C7413B)) (@source==\"ABC_index - ABC-dev\")","constantQueryOverride":"(@z95xlanguage==en) (@z95xlatestversion==1)"}]

Gravatar for jonathan.queiroz@nexio.com

Comment by jonathan.queiroz, May 8, 2019 7:11 PM

For the page load (no query, all facets looks good)...

aq: (NOT @z95xtemplate==(ADB6CA4F03EF4F47B9AC9CE2BA53FF97,FE5DD82648C6436DB87A7C4210C7413B)) (@source=="ABC_index - ABC-dev")

cq: (@z95xlanguage==en) (@z95xlatestversion==1)

groupBy: [{"field":"@profile","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":[]},{"field":"@contenttypes","maximumNumberOfValues":6,"sortCriteria":"occurrences","injectionDepth":1000,"completeFacetWithStandardValues":true,"allowedValues":[]}]

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, May 8, 2019 7:25 PM

The problem in your queries is the `queryOverride":"test"` parameter for the facets (groupBy) requests.

It instruct the search engine to ignore the current search query to retrieve facet values and use the query `"test"` instead. It then gets facet values across languages and sources.

There is no Coveo for Sitecore feature to set this queryOverride from Sitecore. It must be custom JavaScript code in your implementation that sets this.

Ask a question