Gravatar for alex@yaplex.com

Question by AlexShapo, Feb 22, 2018 5:33 PM

How to filter language

What is the format for data-expression?

Currently, I have some documents where language is detected incorrectly (some JSON files, which I probably need to remove from the index), the language identified as Portuguese and Catalan.

So my language facet contain 4 languages now, but I need only 2: English and French. I dont want the users even see anything else besides English and French.

I trying to make expression, but it does not work, it still showing me all languages. And I also can't find documentation about expression language.

Also some documents have 2 languages, French and Catalon, but I dont want to see Catalon in the Facet

data-expression="@contentlanguage=French @language=('French','English')"
data-expression="@contentlanguage=French AND @language=French OR @language=English"
1 Reply
Gravatar for erocheleau@coveo.com

Answer by Etienne, Feb 22, 2018 6:36 PM

Write in the data-expression attribute the same thing you would write in a query.
Example:
`@field==("value1", "value2")`

As for you facet issue, if you follow what we suggested here: https://answers.coveo.com/questions/14754/section-translation.html?childToView=14810#answer-14810

You should be able to add an expression for example on the CoveoSearchInterface to have `@contentlanguage==("french","english")` And use that field in the facet instead of language.

Ask a question