Algolia's advanced syntax highlight issue with single quote char

I have an issue with the Algolia’s advanced syntax and highlighted results. When I put a single quote char “Apostrophe” (’) in the request, it does match my records but the result isn’t highlighted unless I escape the single quote char.

In the following example, I only have one record in my index. The advanced syntax is on and title attribute is searchable.

enter image description here

When I type the title in the query, the highlight seems to be good.

enter image description here

When I put double quotes around the query (to activate exact match from the advanced syntax) it does match the result but the title isn’t highlighted.

enter image description here

BUT if I escape the single quote with a backslash it does highlight it!

enter image description here

Is that a bug from Algolia (since I’m using there own query system)? Did I misconfigured something?

It seems weird to me to escape some chars and if it would be the case, shouldn’t Algolia do it? Or which chars should I escape?

Any help would be greatly appreciated!

Original question on SO :

Hi there, I’m not able to duplicate your results in the Algolia dashboard. It could be related to your configuration.

Could you send a message to us here so that we can help you further:


Hi and thanks for your reply!

To test it, create a brand new index from the dashboard (I’ve named it test).

Add this record manually

  "title": "prise d'acte"

Then in the configuration I only add title to the searchableAttributes and enable advancedSyntax (set to true).

You should now see that "prise d'acte" matches the record but don’t highlight it and "prise d\'acte" matches it AND highlight it.

Hi Cindy,

I don’t have any contact on the support page sadly, but I’ve posted the configuration on my previous message.

Did you find anything?


Hi @weblogin,

You did in fact, find a highlighting bug, and we have created an issue
(tracked it internally as ticket 2473)

We will keep you informed when the issue is fixed.

Hi Cindy and thanks for your answer, can’t wait to hear back from you!