1

Is there a maximum number of terms in an elasticsearch percolator query?

When trying to index a query that has over a 1000 terms, I am getting a StackoverflowError like this:

java.lang.StackOverflowError
    at org.apache.lucene.util.automaton.RegExp.next(RegExp.java:839)
    at org.apache.lucene.util.automaton.RegExp.parseCharExp(RegExp.java:985)
    at org.apache.lucene.util.automaton.RegExp.parseSimpleExp(RegExp.java:980)
    at org.apache.lucene.util.automaton.RegExp.parseCharClassExp(RegExp.java:912)
    at org.apache.lucene.util.automaton.RegExp.parseComplExp(RegExp.java:900)
    at org.apache.lucene.util.automaton.RegExp.parseRepeatExp(RegExp.java:870)
    at org.apache.lucene.util.automaton.RegExp.parseConcatExp(RegExp.java:863)
    at org.apache.lucene.util.automaton.RegExp.parseConcatExp(RegExp.java:864)
    at org.apache.lucene.util.automaton.RegExp.parseConcatExp(RegExp.java:864)

and that last line keeps repeating.

I have tried adding index.query.bool.max_clause_count with a high value (16384) to the elasticsearch.yml file, but that does not resolve the issue.

Is there a resolution or is it more appropriate to break down the query to many significantly smaller queries?

  • This setting does not affect the number of terms allowed. It is the number of clauses allowed in a boolean query. – richardpj Feb 04 '15 at 13:12
  • Your query is too long/complex for the parser to handle. No setting will fix this. Is there a reason you can't decompose this into a couple of queries? A match on any would then be a match on your original. – richardpj Feb 04 '15 at 13:15

0 Answers0