Localized search


We have content with localized fields and we’d like to be able to search our content for specific locales.
By default, it seems the search use the default fallback value.
Is there a way to add the locale in the search in the webapp ?



Hi @jerome.hautecoeur,

I think it’s not possible to search for specific locales in the WebApp, but you can use full-text search on all languages.
I.e. if you have an entry with Spanish locale, and there is la música in a text field, you can search for la música and you’ll find all entries where this word is met.
Please note, you can search for specific locales via CDA, https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/localization.
And this concept guide might be helpful as well: https://www.contentful.com/developers/docs/concepts/locales/ :sunglasses:

Hi @andrey

Thanks for the answer.
Unfortunately, the value we want to filter depending on the locale is a Boolean…


Ok. Can you please share the full scenario, i.e. how would you like to search for specific locales and what is the condition?
I’m not sure we can do it, but probably we can consider it for future.


To give you the whole picture:
We have some contents (articles) that are localized but for one content, all locales can’t be published at the same time (each country works on its side, independantly)
So, to be able to manage a publish-by-local status, we have added a localized field containing the status for the selected locale. We use this status and the Contentful status to determine if a content can be publish on the website.
We would have liked to search on this localized field to be able to set some view for each locales (so people can retrieve easily the status of their content).
Makes sense ?


Hi @jerome.hautecoeur,

Got it. Thank you for the details.
I think you can also create several Boolean fields, i.e. bool field per locale. In each entry you’ll have, for example:

  • bool field name: English, values: Yes/No
  • bool field name: Spanish, values: Yes/No
  • bool field name: German values: Yes/No

In this case, you don’t need to search for content for specific locale, but instead you could search for content by these bool fields:
English: No Spanish: Yes

Let me know if that helps.

Hi @andrey

Could do the job but unfortunately we have too many locales and too many status to have something readable doing it this way.



Got it. Make sense.
I would suggest to use search via CDA then: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/localization

Thank you for interesting feedback! Noted :wink: