[Xapian-discuss] writing match deciders / custom handling of terms
djcb
djcb.bulk at gmail.com
Mon Nov 10 19:20:26 GMT 2008
Hi all,
I'm using Xapian for my mail indexer/searcher[1]; the current version
uses Xapian in tandem with SQLite, but I'm making it Xapian-only now,
mainly for reasons of simplification of the code.
Anyhow, I'd have to compliment the Xapian developers for producing such
a nice piece of work! It works really well, and really fast.[2]
Now, my question is about the MatchDeciders (I think). Suppose I have a
query to find some messages in my Xapian DB, e.g:
subject:foo AND flags:A
which would match message with subject 'foo' and messages with flag 'A'
(having attachments). In the database, flags are just a number. So, I
need some custom handling of this 'flags:A' term, and match the
appropriate documents.
Now, it seems(?) that MatchDeciders are the way to go -- but I don't see
a way to do the custom handling of the flags parameter -- am I missing
something simple?
Thanks in advance!
Dirk.
Footnotes:
[1] http://www.djcbsoftware.nl/code/mu
[2] But: there are some things that seem a bit strange though; e.g. there seems
to be no API to add the prefix to add_term, requiring me to manually
prefix the strings, which seems a bit hackish... and the Xapian::Sorter
which returns a string, which is then sorted; I was expecting something
similar to std::less, or GCompareFunc in GLib; not being able to do
the comparison myself forces me to pad numeric values with 0 etc., so
the sorting works
--
-----------------------------------------------
Dirk-Jan C. Binnema <djcb at djcbsoftware.nl>
blog: http://www.djcbsoftware.nl/ChangeLog (NL)
http://djcbflux.blogspot.com (EN)
chat: djcb at jabber.org
-----------------------------------------------
More information about the Xapian-discuss
mailing list