atomicdata-dev / atomic-server

An open source headless CMS / real-time database. Powerful table editor, full-text search, and SDKs for JS / React / Svelte.
https://atomicserver.eu
MIT License
1.07k stars 49 forks source link

Fuzzy search in custom properties #935

Open joepio opened 3 months ago

joepio commented 3 months ago

As of now, fuzzy search works well for name and description, but not for other fields. I forgot why this is (could be a technical limitation of tantivy), but it would be nice if all text-fields can be fuzzy-searchable.

Polleps commented 3 months ago

This is because fuzzy search only works on string fields. We index name and description as string fields and the rest of the propvals as json.

Maybe we can add configurable fields to be indexed as string instead of json? So a user would add a property that they want fuzzy search on to a config file and then AtomicServer will add that to the Tantivy schema and add fuzzy queries for it in the search endpoint.

joepio commented 3 months ago

Seems like JSON fields are supported in FuzzyTermQuery since 0.22 https://github.com/quickwit-oss/tantivy/pull/2173 !