org.apache.lucene.queryParser.QueryParser.parse(String arg0) throws ParseException when the String arg0 is too long, is there any idea on how to avoid this problem?
Asked
Active
Viewed 150 times
0
-
You don't happen to have a stack trace available? How long queries are we talking about? – sisve Mar 12 '14 at 15:09
-
the query is around 12000 characters and here's the log: – user3411226 Mar 12 '14 at 15:49
-
on second thought the log wouldn't really matter because it's specific, but the problem is obvious i am using org.apache.lucene.queryParser.QueryParser.parse and the string looks somewhat like this: ...OR ID:(61) OR ID:(60) OR ID:(58) OR ID:(54) OR ID:(45) OR ID:(43)) AND (cs_contents:(gaz) OR cs_docs:(gaz))) +DBName:dPortal +TableName:CSBLOG – user3411226 Mar 12 '14 at 15:53
1 Answers
0
Is the issue is length, then the underlying issue is a TooManyClauses exception, I'm guessing.
You can deal with this directly by increasing the max clauses, by calling BooleanQuery.setMaxClauseCount()
.
There a good chance that's just treating the symptom, though. This typically indicates, that you can expect poor performance, due to having such broad queries. You might consider trying to make use of Filter
s for some part of the query, which may solve the issue and improve performance, or otherwise improving how you query the index.

femtoRgon
- 32,893
- 7
- 60
- 87