erquhartE
Convex Community2y ago
19 replies
erquhart

Search order use case

Wanted to share my search use case, which requires ordering, just to add to the conversation. And to learn of any workarounds you might recommend.

My primary search is across financial transactions, so results still have to be ordered by date. It really needs to be paginated.

My best current workaround is not paginating and instead using take(). This has a few issues:

- Most search terms (like "Apple" or "Walmart") turn up lots of results. I'm searching on a combined field that includes subtly different values, so I don't expect perfect ties in relevance for
_creationTime
to be the tiebreaker.
- Because of this, I could be missing the most recent and obvious matches to a query.
- A higher take() number sort of improves chances of matching the right (recent) documents, but there's no guarantee

So big vote from me on ordering for search results.

Any thoughts on how to better approach this for now?
Was this page helpful?