lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Swapnil Patil <ping.swap...@gmail.com>
Subject Re: how to reterieve all results from lucene searcher.search() method
Date Wed, 19 Jun 2013 07:39:46 GMT
you can get all results for given query  "q". By giving documents to fetch
 a very big number like Integer.MAX_VALUE.

But if u want to loop over all documents. Use  index reader and get
document by its doc id from 0 to numDocs (Index reader has method for num
docs).


On Wed, Jun 19, 2013 at 3:11 PM, neeraj shah <neerajshah84@gmail.com> wrote:

> hello,
>
> Is there any way to get all the search result.
> In lucene we get top documents by giving the limit like top 100,1000...
> etc.
> but if i want to get all results.
>
> How can I achieve that??
>
>  Query qu  = new QueryParser(Version.LUCENE_36,"field",
> analyzer).parse(query);
>
>  TopDocs hits = searcher.search(qu,1000);
>

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