Hacker News new | ask | show | jobs
by canadiantim 1153 days ago
Amazing! Thank you, all very encouraging answers. Congrats on everything you've achieved with Cozo so far!!

One last question if possible. Is there a recommended way to do Full Text Search on data stored in Cozo?

1 comments

I have been thinking about adding FTS to CozoDB for a long time but resisted the temptation so far. The reason is that text search is language-specific: what works for one language does not work for another. There is simply no way that CozoDB can duplicate the work of a dedicated text search engine for all the languages in the world.

Our current solution is to use mutation callbacks to synchronize texts to a dedicated text search engine. This is language specific: for example, for python: https://github.com/cozodb/pycozo#mutation-callbacks , and for Rust: https://docs.rs/cozo/latest/cozo/struct.Db.html#method.regis...

Sonic [1] might be a good fit, though it is not yet factored into a separate library [2].

[1]: https://github.com/valeriansaliou/sonic

[2]: https://github.com/valeriansaliou/sonic/issues/150

Thank you, that makes sense. Plus with vector search there seems to be ways of shoehorning FTS with it. Could also potentially use sqlite storage and piggyback off SQlite FTS5 but not sure how well that setup could work