William Morgan <[email protected]> writes:
> Reformatted excerpts from Rich Lane's message of 2009-07-24:
> > You need to specify a non-negated term in the query. "type:mail
> > -label:inbox" should work.
>
> This is a typical restriction for inverted index-based search engines.
> You need to have at least one positive term or the computation is too
> expensive (it would have to iterate over every term ever seen.) It's
> true of Ferret, Google, etc.
Actually, Xapian supports this - Xapian.Query.new("") is a "magic" query
which matches all documents.
It doesn't need to iterate over every term, just all documents. But if you
want the top ten documents without a particular filter, there's no relevance
ranking, so it can stop after it has found ten matches, which should be
pretty quick.
This isn't currently supported by the QueryParser when using "-" on terms
(the reasoning was that it was too easy to accidentally invoke when pasting
text), but 'NOT label:inbox' will work if you enable it using
QueryParser.FLAG_PURE_NOT.
Cheers,
Olly
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk