Searching among facet values


I searched a while to find a workaround (unsuccessfully), then I wonder if you may give me some suggestion… Here is my issue :

I have an index with many indexed contents that might have an attribute which is used as a facet filter. It works fine. My facets values are some kind of chemical compounds whose names are often quite complicated. The application offers the possibility to search among these facet values by using searchForFacetValues. This works as expected, except one specific case : users sometimes filter by typing the beginning of the names, which gives correct results, but sometimes they type some part of the name (e.g. they type “progesteron” and expect to get “medroxyprogesterone” among results)… and this does not work.

As far as I see it is not possible to search in facet values by using some “contains” rule, and I guess I cannot use the following : Querying in the middle of a word | Algolia as it’s probably not possible for facet values.

I hope I’m clear…
Do you have any clue about how I could proceed ?

Thanks in advance for your time,
Nicolas Pineau.

I asked Algolia, here is the answer :cry: :

By design, Algolia is a prefix-search based engine and doesn’t support infix/suffix matching; therefore it won’t find substrings in the middle or the end of a string.

As there is a way of generating alternatives for search results, it is not possible to do that for facet values.

I’ll probably have to to create another index to deal with that.