[Xapian-discuss] How to search URL field (unique Q key)?
James Aylett
james-xapian at tartarus.org
Tue Aug 1 09:41:56 BST 2006
On Mon, Jul 31, 2006 at 09:51:08AM -0800, oscaruser at programmer.net wrote:
> If I'm not mistaken, the approach of printing all of the Q terms
> basically dumps the database contents, but does no searching. If the
> URL field was set to unique, I would imagine that there is a method
> of searching against the key. Based on the functionality of
> scriptindex, it determines whether to the record already exists or
> not before updating or adding to the index. This latter
> functionality is the one I want to utilize because based on the
> nature of the datastructure and keys, searching should be very
> fast. I'll check the scriptindex sources to see if I can understand
> what's going on there.
Yes, possibly I solved your problem rather than answered your
question. If you want to know if a particular term exists in the
database or not, use Xapian::Database::term_exists(). That's painful
by comparison with just doing what I suggested to get all the URLs
that have been indexed out (unless you already have a rig for deciding
whether to add a particular document or not).
(scriptindex may just use replace_document(), I can't actually remember.)
James
--
/--------------------------------------------------------------------------\
James Aylett xapian.org
james at tartarus.org uncertaintydivision.org
More information about the Xapian-discuss
mailing list