Replies: 1 comment
|
The short answer is that you add Why the pool cannot grow with the offset RRF ranks are assigned inside the candidate CTEs. Change how many rows those CTEs return and you change every rank, which changes the fused order. So if you size them from the offset (page 1 pulls 60 rows, page 5 pulls 140) you get a different ranking on every page: rows enter the text candidate list as the pool widens, pick up a contribution they did not have before, and jump the order. I measured this on a 500 row table, paging 8 times with a page size of 10. Growing the pool per page returned 71 distinct rows instead of 80, and 9 rows that a single So pick a maximum depth you are willing to serve, set both CTE limits to that constant, and refuse to go past it: -- in both CTEs, a constant, not derived from match_count or the offset
limit max_depthThat is what Elasticsearch does with Two things in the function that will make pages unstable anyway
On your actual question about I ended up packaging all of this after hitting the same wall: pghybrid generates the statement with the pool fixed, a tiebreaker on both sides, and it raises rather than returning an empty page when you ask for a page outside the pool. Python and TypeScript, MIT. But the three fixes above are the whole of it and you can apply them to the function you already have. |
Uh oh!
There was an error while loading. Please reload this page.
so my question is how am I going to paginate the hybrid_seach function which is
I am asking this question because I am not able put the where clause like distance < from in this CTE
because I am using HSWN index and pgvector for postgresql and the pgvector github page clearly points out that if I ever use the where clause inside of the same query of embeddings comparison , the index will not be used so do you have any advice for this particular problem?
All reactions