ballingt
ballingt3y ago

Searching in Convex

For now full table scan is how I'd go about it. We know that's going to fall down past a certain size of data but it's interesting (well I think so) to push the limits of that approach atm. There are several potential options, some involving egress to dedicated search infra services. Pragmatically you could denormalize the data, building a search index in Convex (another good candidate for a plug and play library) but we can provide something more convenient before long.
6 Replies
james
james3y ago
Yep @RJ the best bet you have today is to do a table scan, but quite soon we'll have support for streaming data out of Convex into external systems like Elasticsearch etc. This will also be useful for bulk analytics-type workloads that are a poor fit for an OLTP database (i.e., a low-latency customer-facing database like Convex) If there's sufficient demand for native search within Convex this is something we could consider implementing internally
casado
casado3y ago
Fyi, this is the approach I took and it worked fine, however I ran into query limits. This is where pagination will help a lot once it lands ...
RJ
RJ3y ago
Thank you everyone! That all makes sense to me. I imagine I would really want some native (or library) support for searching in Convex. It would seem a shame to need to pull in a new service/system for fairly basic full text search needs, especially if something like Postgres would have been able to handle the same needs all on its own, at comparable scale.
james
james3y ago
ah, if it's just the kind of search that you could get from postgres, i.e., a table scan with a LIKE query rather than an actual search index, then that should likely be fine with convex as-is (with addition of pagination)
RJ
RJ3y ago
I was initially asking specifically about LIKE, but in my previous comment meant Postgres plus modules like fuzzystrmatch (https://www.postgresql.org/docs/current/fuzzystrmatch.html) and pg_trgm (https://www.postgresql.org/docs/current/pgtrgm.html)
Gorka Cesium
Gorka Cesium3y ago
How is it going with text search? Is there a limit of items when querying with collect()?

Did you find this page helpful?