On 9/25/13 2:50 PM, Anil Pachuri wrote:
Hi Peter,

When I run the program below for different queries, it gives me
different values for $hit_count and number of elements in the array
@doc_ids . @doc_ids always shows 10 elements even for different queries,
while $hit_count value changes with query. May be I am missing something.

You want the num_wanted param for hits().


Thanks, Anil

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,

  num_wanted => 1_000_000,   # really big number

);





--
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to