Change text of Facet input coming from schema

Hello im implementing Search UI, im using facet components, i have a filter that has two values that come from schemas "offers" and "articles". Since our schema is in english but the website is in German i would like to know if there is a possibility to change the label of the Facet inputs.

my engine.json has: 
    "facets": ["type", "locality"]

in my react component I iterate and render each Facet.

 <Facet
      key={field}
      field={field}
      label={field.replaceAll(_',' ')}
  />

Rendered html:

Screenshot 2023-01-17 at 16.32.27

What i need below "TYPE" filter is : Artikel , Angebote instead of article and offers

Hey @Max4

You can override the view for the component. See instructions Facet | Elastic docs.

Heres an example of the MultiCheckboxFacet Display component search-ui/MultiCheckboxFacet.tsx at main · elastic/search-ui · GitHub

Then you can assume the facet value is an id. Have a map for id to labels or use with a localisation string if you're supporting multiple languages.

Hope this helps.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.