Unable to use "-" in search


My team and I have multiple objects that we’d like to include in search results that may potentially have ---- prefixed to the rest of the string as in ----1234ABC.

Using things such as react-instantsearch-core and algoliasearch/lite, we are unable to utilize the ---- in a search and only get a result for the above example by searching 1234ABC with no - included.

We have added both "-" and "----" to the Separators characters to index within the Relevance Optimizations section of our dashboard.

Do we have any other ways of allowing these values to be searchable by the special characters?

You only need the single dash in the Seperators characters to index field if you want to include the dashes to be searchable — the values - and ----- function the same and including both isn’t required.

With this setting configured, you can include the dashes to your search query as long as you do not have the Advanced syntax setting enabled (Search Behavior > Advanced syntax). If you have Advanced syntax enabled, the presence of dashes will remove any results matching that word - even if it’s configured as a searchable separator like above and will not allow you to query like this.

You can swap the dashes for another allowed character before indexing the record, or disable Advanced syntax if it is not as important as being able to search for these records if you do have it enabled.

Let me know if this works for you! Thanks!

Thanks for your response @michael.king. I removed the ---- in favor of just the - within Seperators characters to index. Unfortunately, it looks like our advanced syntax setting being enabled is defaulted to false so I don’t believe that aspect is involved here. It appears searching with something similar to 123- will work but -- as an initial search returns no results.

We have made changes on our side to prevent the ---- prefix we had created previously to prevent this issue going forward. Seems like not much else can be done. Thanks again.