I have an issue after upgrading Typesense (Cloud) ...
# community-help
m
I have an issue after upgrading Typesense (Cloud) to 0.20. I have a “slug” field in an index for a blog. Looking up a specific post doesn’t work anymore since the upgrade to 0.20, and this relates to the length of the slug (words separated by hyphens). Anything longer than two words makes the query fail. Any query parameter I should add, or changes to the index I can make?
j
Hi Martin, could you give me an example of a search query (with all the search parameters used) that fails? Also, when you say "fails" does it return a non-200 HTTP error code or does it not return any results?
m
200 status but zero results.
j
As a test, could you remove all the hyphens in the search query and try searching as one long word?
m
When I shorten the query to a partial slug
open-access
I get three results.
Removing all hyphens fixes it. Even when I keep the first two hyphens.
Thanks a lot @Jason Bosco I know what to do in my Javascript client. Can you explain what the query parser is doing and how to override it (other than changing the query string)?
j
So we currently drop all special characters when indexing and when searching. So
open-access-may-become-mandatory...
will get indexed as
openaccessmaybecomemandatory...
. Not ideal, but we plan to fix this in an upcoming release, so you can customize how special characters are indexed.
re: solution for the problem at hand - Are you looking to retrieve a single post by its slug?
m
Yes. And the UI gives me the slug rather than for example the ID (a uuid).
j
Could you try setting slug as a faceted field, and then using filter_by:
slug:=slug-with-hyphens
?
m
Sure. But need to update schema, so needs a moment. Is
filter_by
better here than
query_by
?
j
Yeah, if you're looking for an exact match and for a single record, filter_by is a better approach
k
I'm able to reproduce this issue. There was indeed a regression on v0.20. The fix is easy enough and I can produce a RC build for you to test locally. If that goes fine, we can upgrade your cluster to the RC version. Does that sound good?
m
Thanks @Kishore Nallan but using
filter_by
, as suggested by @Jason Bosco fixes the issue for me.
k
Ok, sounds good. 👍
m
But thanks for looking into this. This might also affect others upgrading to 0.20.
👍 1