views:

56

answers:

2

Hi all, my question is simple but i cant fin de answer. Is there a way to set in Lucene to retrieve an amount of results higher than 100 in a query? Im using lucene 2.4.0 now.

Thanks all.

+1  A: 

Functionality for controlling the search result size and itarations over larger search results has been vastly improved in later versions of Lucene. If you have the possibility, consider upgrading to 2.9 or even 3.0.

That being said, I cannot from your post determine how exactly you get your search results returned. Perhaps you use a Hits object? In that case you should consider using the TopDocCollector instead. The TopDocCollector(int) constructor allows you to specify the maximum number of hits you would like to have returned from your search.

Steen
A: 

In 2.4.0, you can use Searcher.search(Query query, int n) method to retrieve desired number of results. The method returns TopDocs object.

Shashikant Kore