We're currently facing a challenge with a client who requires a filter for their App Search search query.
We've already consulted the Elastic documentation and have implemented a value filter. However, our issue lies in the specificity of the value filter, which doesn't align with our use case.
In our scenario:
We have a field named available_languages.
This field can contain values like fr:de:en or potentially nl:de and various other combinations.
Our goal is to apply a value filter to the available_languages field using a specific value, for instance, fr However, the current setup only works when there's an exact match with fr in the available_languages field, rather than matching all values like fr:en…
Is there a way to achieve this flexibility in the value filter or with another filter?
Hi there @Chenko - I think the easiest solution here would be to reformulate your data if possible to index the available languages as an array rather than as a delimited string.
So instead of indexing available_languages as fr:de:en you would index something that looked like this:
PUT /my-stuff/_doc/1
{
"available_languages": [ "fr", "de", "en" ]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.