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

Sakai JIRA | Ivan Masár | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The fulltext:[* TO *] Discovery query can be used to find all items that have a bitstream. This used to work in DSpace 1.8, but is broken in DSpace 3 when search results highlighting is enabled. I was able to get it to work by setting maxClauseCount to 4096 (the default is 1024), but the query also took quite long. INFO: [search] webapp=/solr path=/select params={f.dc.title_hl.hl.fragsize=0&f.dc.title_hl.hl.snippets=5&sort=score+desc&hl.fl=dc.description.abstract_hl&hl.fl=dc.title_hl&hl.fl=dc.contributor.author_hl&hl.fl=fulltext_hl&f.fulltext_hl.hl.fragsize=250&wt=javabin&hl=true&rows=10&version=2&f.fulltext_hl.hl.snippets=2&f.dc.description.abstract_hl.hl.snippets=2&f.dc.contributor.author_hl.hl.snippets=5&start=0&q=fulltext:[*+TO+*]&f.dc.contributor.author_hl.hl.fragsize=0&hl.usePhraseHighlighter=true&fq=NOT(withdrawn:true)&fq=read:(g0)&f.dc.description.abstract_hl.hl.fragsize=250} hits=15863 status=500 QTime=3118 Jul 12, 2013 5:03:35 PM org.apache.solr.common.SolrException log SEVERE: org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024 at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:136) at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:127) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:51) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:41) at org.apache.lucene.search.ScoringRewrite$3.collect(ScoringRewrite.java:95) at org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:38) at org.apache.lucene.search.ScoringRewrite.rewrite(ScoringRewrite.java:93) at org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:304) at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:158) at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:385) at org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:217) at org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:185) at org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:205) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:490) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:401) at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:131) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.solr.filters.LocalHostRestrictionFilter.doFilter(LocalHostRestrictionFilter.java:60) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:316) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:636)

    Sakai JIRA | 4 years ago | Ivan Masár
    org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024
  2. 0

    The fulltext:[* TO *] Discovery query can be used to find all items that have a bitstream. This used to work in DSpace 1.8, but is broken in DSpace 3 when search results highlighting is enabled. I was able to get it to work by setting maxClauseCount to 4096 (the default is 1024), but the query also took quite long. INFO: [search] webapp=/solr path=/select params={f.dc.title_hl.hl.fragsize=0&f.dc.title_hl.hl.snippets=5&sort=score+desc&hl.fl=dc.description.abstract_hl&hl.fl=dc.title_hl&hl.fl=dc.contributor.author_hl&hl.fl=fulltext_hl&f.fulltext_hl.hl.fragsize=250&wt=javabin&hl=true&rows=10&version=2&f.fulltext_hl.hl.snippets=2&f.dc.description.abstract_hl.hl.snippets=2&f.dc.contributor.author_hl.hl.snippets=5&start=0&q=fulltext:[*+TO+*]&f.dc.contributor.author_hl.hl.fragsize=0&hl.usePhraseHighlighter=true&fq=NOT(withdrawn:true)&fq=read:(g0)&f.dc.description.abstract_hl.hl.fragsize=250} hits=15863 status=500 QTime=3118 Jul 12, 2013 5:03:35 PM org.apache.solr.common.SolrException log SEVERE: org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024 at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:136) at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:127) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:51) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:41) at org.apache.lucene.search.ScoringRewrite$3.collect(ScoringRewrite.java:95) at org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:38) at org.apache.lucene.search.ScoringRewrite.rewrite(ScoringRewrite.java:93) at org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:304) at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:158) at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:385) at org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:217) at org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:185) at org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:205) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:490) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:401) at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:131) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.solr.filters.LocalHostRestrictionFilter.doFilter(LocalHostRestrictionFilter.java:60) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:316) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:636)

    Sakai JIRA | 4 years ago | Ivan Masár
    org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024
  3. 0

    Wildcard query generates 500 error, no user feedback

    GitHub | 2 years ago | aaccomazzi
    org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Solr: ComplexPhraseQueryParser ignores maxBooleanClauses value in solrconfig.xml

    Stack Overflow | 2 years ago | mindfxxxedCoder
    org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024
  6. 0

    ElasticSearch: TooManyClauses exception when adding highlight

    Stack Overflow | 2 years ago | Markos Fragkakis
    org.elasticsearch.search.fetch.FetchPhaseExecutionException: [markosindex][0]: query[filtered(fileTextContent.fileTextContentAnalyzed:aluminium fileTextContent.fileTextContentAnalyzed:potassium +DOS_UUID:*)->cache(_type:markostype)],from[0],size[10]: Fetch Failed [Failed to highlight field [fileTextContent.fileTextContentAnalyzed]]

    Root Cause Analysis

    1. org.apache.lucene.search.BooleanQuery$TooManyClauses

      maxClauseCount is set to 1024

      at org.apache.lucene.search.BooleanQuery.add()
    2. Lucene
      MultiTermQuery.rewrite
      1. org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:136)
      2. org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:127)
      3. org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:51)
      4. org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:41)
      5. org.apache.lucene.search.ScoringRewrite$3.collect(ScoringRewrite.java:95)
      6. org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:38)
      7. org.apache.lucene.search.ScoringRewrite.rewrite(ScoringRewrite.java:93)
      8. org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:304)
      8 frames
    3. Lucene Highlighter
      Highlighter.getBestTextFragments
      1. org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:158)
      2. org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:385)
      3. org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:217)
      4. org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:185)
      5. org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:205)
      5 frames
    4. Apache Solr Core
      SolrDispatchFilter.doFilter
      1. org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:490)
      2. org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:401)
      3. org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:131)
      4. org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
      5. org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
      6. org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
      7. org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
      8. org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
      8 frames
    5. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    6. org.dspace.solr
      LocalHostRestrictionFilter.doFilter
      1. org.dspace.solr.filters.LocalHostRestrictionFilter.doFilter(LocalHostRestrictionFilter.java:60)
      1 frame
    7. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:316)
      6. org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
      7. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      8. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      10 frames
    8. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      3 frames
    9. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:636)
      1 frame