Xapian Perl Bindings

From Dev411: The Code Wiki

Retrieving results with get_mset

The Search::Xapian POD shows how to retrieve matches using the $enq->matches method, however sometimes it's preferable to get the match results through the mset object. You can do so with the following:

 my $enq = $db->enquire( '[QUERY TERM]' );
 my $mset = $enq->get_mset(0,10);
 my $iter = $mset->begin;
 while ($iter ne $mset->end) {
   my $doc = $iter->get_document;
   ++$iter;
 }