Lucy::Search::Hits - Access search results.
my $hits = $searcher->hits( query => $query, offset => 0, num_wanted => 10, ); while ( my $hit = $hits->next ) { print "<p>$hit->{title} <em>" . $hit->get_score . "</em></p>\n"; }
Hits objects are iterators used to access the results of a search.
my $hit_doc = $hits->next();
Return the next hit, or undef when the iterator is exhausted.
my $int = $hits->total_hits();
Return the total number of documents which matched the Query used to produce the Hits object. Note that this is the total number of matches, not just the number of matches represented by the Hits iterator.
Lucy::Search::Hits isa Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.