[Xapian-discuss] Get Document Position in Search
James Aylett
james-xapian at tartarus.org
Thu Jul 9 23:19:51 BST 2009
On Thu, Jul 09, 2009 at 02:56:49PM -0700, Ryan Bates wrote:
> In this situation the items are being edited at the same time (think of an
> "edit next" button on a form). This spawns a background process which
> updates the Xapian database within minutes, so the chances are quite high
> the modifications will change the search results. Storing a simple offset
> won't work here since it could easily skip records.
Two options:
1. ignore the record skipping; this is cheap, and in most cases you'll
get away with it
2. have the "next document" link contain the current doc id, and the
page number, so you can at least start in roughly the right place
Bear in mind that scrolling through a search result set (which is what
prev/next buttons do) makes little sense if you also acknowledge the
change in the results set anyway. The whole thing is invalidated (and
Xapian currently doesn't have a way of holding the previous revision
of the database indefinitely). So you have to compromise somewhere,
it's just a matter of what makes the most sense to your users :-)
J
--
James Aylett
talktorex.co.uk - xapian.org - uncertaintydivision.org
More information about the Xapian-discuss
mailing list