Shripad Bodas
2010-Dec-28 22:30 UTC
[Xapian-discuss] Printing all records when search is not present
Hi, I want to print all the records from the passed database when the search string is not present. I quickly skimmed through the API but I couldn't find a way to do it. Can someone show some pointers. Thanks, Shri
Olly Betts
2011-Jan-11 12:49 UTC
[Xapian-discuss] Printing all records when search is not present
On Tue, Dec 28, 2010 at 05:30:34PM -0500, Shripad Bodas wrote:> I want to print all the records from the passed database when the > search string is not present. I quickly skimmed through the API but I > couldn't find a way to do it. Can someone show some pointers.Just use Xapian::Query::MatchAll and AND_NOT. So if q is the Query object from parsing your search string: Xapian::Query all_but_q(Xapian::Query::AND_NOT, Xapian::Query::MatchAll, q); MatchAll is very efficient if there are no gaps in the docid numbering. If that isn't the case, it's more efficient with chert (default backend in Xapian 1.2) than with flint (default backend in 1.0). Cheers, Olly