indexSearch with "match"
Hello, I'm trying to make a simple search index, but the db will be large, because is customers db, and we have more than 10.000.
I wanna search the user by a name query, example, when user search mari this will match with (maria, mariah, mariana) on documentation, i'm trying to do with the tasks table, and the only match with the exacly word.
7 Replies
Hey @gwilliamnn , this is a current limitation of our Search beta, it only supports exact word match. Totally agree with you that this is limiting/surprising. For now you'll either have to:
- Work around this in Convex by adding a table with name prefixes (ma, mar, mari...) that point to a list of customer Ids - then you can search this table for exact match
- Plug in external search solution like Elastic search
We might be adding the prefix search or a vector search capability in the future. Vector search might or might not serve your needs (since it won't be exact prefix search).
how make this external soluction?
Hello @Michal Srb, just to confirm. If a document had a field with the value "what is a walrus"? Would the query 'walrus' match to this document or will it only match to a field that is exactly as 'walrus'? Thanks!
Yes.
(@gwilliamnn is correct, search for "walrus" does match "what is a walrus")
@gwilliamnn for an external solution you'd want to look into our the export functionality we support to export your data to an Elastic Search DB and then query it from actions.
https://docs.convex.dev/database/import-export/airbyte
Using Convex with Airbyte | Convex Developer Hub
Analyze your Convex data by exporting via Airbyte.
Awesome, perfect for my use case. Thanks!