lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil Pachuri <anilpach...@yahoo.com>
Subject [lucy-user] document IDs
Date Tue, 24 Sep 2013 17:44:55 GMT
Hi,

Please suggest how to get doc IDs of hits. I am assuming Lucy assigns internal IDs (starting
with 0?) to each document in the index.

my $searcher = Lucy::Search::IndexSearcher->new( 
index => $path_to_index,
);

my $qparser = Lucy::Search::QueryParser->new( 
schema => $searcher->get_schema,
default_boolop => 'OR',
);

my $query = $qparser->parse('query');
my $hits = $searcher->hits(
query => $query,
);

my $hit_count = $hits->total_hits;

# something like:
my $docIDs = $hits->doc_ids;

Thanks!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message