lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Getting all the matching documents for a search
Date Thu, 01 Jun 2006 08:11:08 GMT

On Jun 1, 2006, at 3:49 AM, Chun Wei Ho wrote:
> I use Hits to search for and get documents matching a particular  
> query, e.g.:
> Hits hits = indexSearcher.search(new TermQuery(new Term 
> ("startswith","A")));
>
> but it is not returning all the matching documents in the index. From
> experimentation it appears to return about less than half the matching
> documents unless the number of matching documents is less than 100. Is
> there an option that I can specify so that it returns the whole list
> of matching documents?

What do you mean it is not returning all of the documents?  If you  
iterate through the documents provided by Hits it will return _all_  
documents that match that Query.  I recommend you have a look at your  
index with Luke and ensure things are indexed as you expect.  There  
are other IndexSearcher.search() methods you can use that use  
HitCollector or return TopDocs instead of Hits - you could use those  
but the issue is likely nothing those methods would fix.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message