lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Leangen <apa...@leangen.net>
Subject How can I limit the number of hits in my query?
Date Mon, 14 May 2007 07:24:02 GMT

Hello!

I am new to Lucene, so forgive me if my question is basic. I did try
googling for an answer...


For an ajax autocomplete widget, I am querying using Lucene. I only want
to return, for example, the first 20 hits of anything that Lucene finds
in whatever order Lucene gives to me.

Two questions:

 - How can I limit the number of hits? I don't know in
   advance what the data will be, so it's not feasible for
   me to use RangeQuery.

 - Will this solve the problem I am getting with maxClauseCount?

   org.apache.lucene.search.BooleanQuery$TooManyClauses
   maxClauseCount is set to 1024


Thank you!
David




---------------------------------------------------------------------
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