hi mueller,
yes that's a strong limitation of all information retrieval systems - not limited to Lucene only.
As you have guessed it's building a boolean query containing all matching terms from the prefix, the maxClauseCount is set to a default of 1024 and you could set that higher but it won't solve the problem for all cases - and possibly make the system perform badly.
The usual solution which is implemented in these cases is exactly what you suggest:
Quote:
It's very important that I allow wildcard searching to our users. Hibernate Search and Lucene have to allow this kind of searching, right? Even if it's severely limited, I'd love to check first and tell the user, "sorry our search mechanism isn't capable of search a* because you need to be more specific, try another letter after a" rather than "sorry, there was a problem."
That's right, so you should catch the TooManyClauses exception and show a message to the user to politely ask to refine it's search terms - you might have noticed this on many online services.
Google does some complex workarounds, you might notice that the simple query "A*" does return the same as "A", while using a star in a more complex text results in somewhat unexpected results... there's no general solution; you can set the clauseLimit very high and verify how bad the performance goes.