Issue with Typesense Search and Special Characters

TLDR gab faced an issue with Typesense when searching with special characters. Jason and Kishore Nallan provided support and identified the issue as a bug. The problem was resolved after upgrading to `0.25.0.rc44`.

Photo of gab
gab
Tue, 04 Jul 2023 15:43:55 UTC

Hi, Whenever I do a search with a special character ex: q=")", documents are returned but some fields are wrong: all string fields that are not facets fields are returned undefined. String fields that are not facets fields are welle returned. Other fields are also well returned. It seems to be a bug. I can reproduce easily on my typesense cloud instance (v0.24.1.rc9)

Photo of Kishore Nallan
Kishore Nallan
Tue, 04 Jul 2023 15:48:17 UTC

Can you please try on 0.24.1 GA? `0.24.1.rc9` is pre-release RC build on 0.24.1

Photo of gab
gab
Tue, 04 Jul 2023 16:11:48 UTC

Ok I have just updated to 0.24.1 locally but I still have the same issue

Photo of gab
gab
Tue, 04 Jul 2023 16:13:59 UTC

In addition to my previous notes, this issue is occuring whatever collections I'm querying

Photo of gab
gab
Tue, 04 Jul 2023 17:19:05 UTC

I found that when there is no match at all (`matchLevel === 'none'`), `_highlightResult.value` (which is an object built from typesense client library) contains a string `"undefined"`. I don't know if it is because of wrong server response or wrong client parsing from Typsense client library. I'm using Typesense `v1.5.3`

Photo of gab
gab
Wed, 05 Jul 2023 08:33:21 UTC

Jason Is it a known issue in typesense-js ?

Photo of Jason
Jason
Wed, 05 Jul 2023 15:04:53 UTC

gab `_highlightResult` is added by the typesense-instantsearch-adapter library, not typesense-js. Could you try upgrading to the latest version of the adapter?

Photo of gab
gab
Wed, 05 Jul 2023 15:07:04 UTC

Ok I will give a try to go from `2.6.0` to `2.7.0`

Photo of gab
gab
Wed, 05 Jul 2023 15:11:27 UTC

Jason There is still the same behavior with latest typesense-instantsearch-adapter library. Also this behavior can be seen on your interface ``

Photo of gab
gab
Wed, 05 Jul 2023 15:11:56 UTC

Man just have to type for instance `+` or `)` in the search query field

Photo of gab
gab
Wed, 05 Jul 2023 15:14:07 UTC

Photo of Jason
Jason
Wed, 05 Jul 2023 15:14:23 UTC

This message contains interactive elements.

Photo of Jason
Jason
Wed, 05 Jul 2023 15:15:00 UTC

Could you open the network inspector in the browser dev console, then do the search, look for a request to multi_search and then copy-as-curl and DM it to me?

Photo of Jason
Jason
Wed, 05 Jul 2023 15:31:35 UTC

Thank you!

Photo of Jason
Jason
Wed, 05 Jul 2023 15:41:25 UTC

This is a bug on the typesense-server side. We fixed a variation of this issue in a recent RC build of 0.25.0. Can we upgrade you to this build?

Photo of gab
gab
Wed, 05 Jul 2023 15:45:00 UTC

Ok Thanks let's do this, can you also confirm me the exact version so I can align our local Docker image ?

Photo of Jason
Jason
Wed, 05 Jul 2023 15:45:38 UTC

Going to queue up an upgrade to `0.25.0.rc44`

Photo of gab
gab
Wed, 05 Jul 2023 15:48:04 UTC

Does it makes sense to align our env with `0.25.0.rc41` ? It is the latest published Typesense docker tag I can find.

Photo of Jason
Jason
Wed, 05 Jul 2023 15:50:53 UTC

Yeah all the updates since then have been with vector search related features

Photo of Jason
Jason
Wed, 05 Jul 2023 15:51:34 UTC

But we’ll also publish docker tag for `0.25.0.rc44` shortly

Photo of Kishore Nallan
Kishore Nallan
Wed, 05 Jul 2023 15:51:40 UTC

Let me publish rc44

Photo of Kishore Nallan
Kishore Nallan
Wed, 05 Jul 2023 15:52:17 UTC

Published, please use that.

Photo of Jason
Jason
Wed, 05 Jul 2023 15:52:18 UTC

Cloud cluster upgrade just completed - I no longer see the issue. Could you confirm as well?

Photo of gab
gab
Wed, 05 Jul 2023 15:53:57 UTC

Yep as far as I can see from typesense cloud interface it is now fixed. I will check on our production env where I had to apply some hack to not display the undefined value. Thanks a lot

Photo of gab
gab
Wed, 05 Jul 2023 15:55:12 UTC

Kishore Nallan thanks :+1: