How can I filter item based on First character of the property in Algolia instantsearch

Assume I have index with country and description, I want to create filter where use can select one or more characters from the alphabet list A- Z (A,B,C … Z) in the filter.
So based on the selection result should filter with country attributes first character.

i.e If I select “S” in as char in the filter list I should be able to see hits with Countries that are starting with S character. Sri Lanka, Singapore as an example

Hi there,

I’m Dorian, software engineer at Algolia.

Would something like this solve your problem?

image

This is taken from our instantsearch live demo, and the source code is located here. More specifically, it’s using the instantsearch refinementList component as you can see here.

Under the hood, this uses our search for facets feature as detailed here.

In your case, you could specify that the country is a searchable facet and use that feature to achieve what you want.

Let me know if this helps!