Gravatar for

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

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

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

As for you facet issue, if you follow what we suggested here:

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