0

We have a field in our Elastic App Search called «categories», containing the value «fruit, vegetables».

In our paylod we are trying to filter the search by «fruit». But as the filter needs to be an exact match, we don’t get any results.

There must be a way to match a filter with the comma separated document value, right?

4

1 回答 1

1

App Search supports arrays for filtering, so instead of indexing that field as "fruit, vegetables", provide it as ["fruit", "vegetables"] and they will be considered as independent values for the document, which would match for either of them.

Reference: https://www.elastic.co/guide/en/app-search/current/filters.html

于 2022-01-27T02:27:39.060 回答