[Xapian-discuss] add_document with starting docid
Andrey
alpha04 at netvigator.com
Tue Nov 27 05:22:25 GMT 2007
Hi
Is the sort_by_value() currently use string comparasion only? I found it's
kind of expenisve by inserting timestamps in the value slot and use it to
sort the result, comparing with the sort_by_docid()
My work-around off this is to use the sort_by_docid() + a search term
"XSYNC_TIME" to sort the newest doc.
But when working with multi-databases, DB2's doc are not after DB1's.
(interleave of the document ids over DBs)
By reading this post from Olly...
http://lists.tartarus.org/pipermail/xapian-discuss/2007-March/003539.html
============================================
Hmm, actually I see a neat hack. If you add the first document to db2
with a document id at least one more than the last document id of db1
then the merged document ids will preserve the order within each db
but put all the documents in db1 before those in db2. Currently
xapian-compact preserves spans of unused document ids at the start and
end of the database, but that would be easy to fix.
============================================
How to add the first doc to db2 with a specific document id? Isn't it
automatically allocated from 1?
Thanks and appreciated
Andrey
More information about the Xapian-discuss
mailing list