[Xapian-discuss] Search::Xapian add_database'd search results are
odd?
Olly Betts
olly at survex.com
Tue Dec 21 21:56:25 GMT 2004
On Tue, Dec 21, 2004 at 01:32:13PM -0800, Eric Parusel wrote:
> Anyways, I've been testing out using $db->add_database() when searching,
> and it seems like the docids I'm getting out of it are incorrect, almost
> as though they're "double" what they should be (numerically)...
>
> the docids that exist should be around 950,000 and 1000000 not around
> 1900000, etc...
If you search over more than one database, the docids in the underlying
databases are mapped to avoid collisions.
The mapping is (at least currently):
did_merged = (did_raw - 1) * number_of_databases + offset
where offset ranges from 1 to number_of_databases.
You can generally just treat did_merged as an opaque value and use it
with the combined database to retrieve the appropriate document.
Cheers,
Olly
More information about the Xapian-discuss
mailing list