lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: Prefix Query for autocomplete - TooManyClauses
Date Sat, 14 Nov 2009 02:52:38 GMT

Also keep in mind prefix queries are not the cheapest.
We've seen people use this successfully:
I believe somebody is trying this out with a set of 1B suggestions.  The demo at
searches 6M Wikipedia titles with a a *tiny* JVM heap.


----- Original Message ----
> From: Anjana Sarkar <>
> To:
> Sent: Fri, November 13, 2009 8:50:38 AM
> Subject: Prefix Query for autocomplete - TooManyClauses
> We are using lucene for one our projects here and has been working very well
> for last 2 years.
> The new requirement is to use it for autocomplete. Here , queries like a* or
> ab* pose a problem.
> I have set BooleanQuery.setMaxClauseCount( Integer.MAX_VALUE ) to get around
> the TooManyClausesException.
> The issue now is performance is not acceptable. It takes about 3 secs for a*
> query to return results.
> I have 250,000 documents , each document is 5 - 15 words in the indexed
> field and am using StandardAnalyzer. I have tried using a filter,
> since in this case, I am only interested in documents with a boost higher
> than a certain number. I had
> the boost value as a separate lucene indexed field so I can filter on it.
> I realized that the filtering is only applied after the boolean query is
> prepared and scored, so there is no performance benefit with using that
> approach.
> I cannot use a ConstantScoreQuery as I need the top n matches for the query.
> Any suggestions on how I can get around this issue will be highly
> appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message