Partial search filtering

TLDR Jason asked about partial match searching in Typesense similar to SQL's LIKE. Jason explained that Typesense has "prefix search" by default but "infix search" can be done by setting the search parameters.

Photo of Jason
Jason
Thu, 09 Feb 2023 20:35:49 UTC

is it possible to filter by a partial match simliar to sqls `LIKE`?

Photo of Jason
Jason
Thu, 09 Feb 2023 20:37:35 UTC

Typesense by default does a prefix search (controlled by `prefix: true` search parameter). So that’s equivalent to SQL’s `LIKE xyz%`

Photo of Jason
Jason
Thu, 09 Feb 2023 20:38:22 UTC

If you need to do `LIKE %xyz%` that’s called infix search. You’d need to set the `infix` search parameter at search time and also set `infix: true` for the field in the collection schema (this is a CPU-intensive operation)

Photo of Jason
Jason
Thu, 09 Feb 2023 20:41:38 UTC

Thank you!