Regarding the error:

   -

   "solr.xml maxBooleanClauses is now enforced recursively. Users who
   upgrade from prior versions of Solr may find that some requests involving
   complex internal query structures (Example: long query strings using
   edismax with many qf and pf fields that include query time synonym
   expansion) which worked in the past now hit this limit and fail. Users in
   this situation are advised to consider the complexity of their
   queries/configuration, and increase the value of maxBooleanClauses
   
<https://solr.apache.org/guide/solr/latest/configuration-guide/configuring-solr-xml.html#global-maxbooleanclauses>
if
   warranted.*"*


*from 
https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html
<https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html>*

You can configure/increase this limit in solrconfig.xml
<maxBooleanClauses>...</maxBooleanClauses> or pass it to the jvm via the
SOLR_OPTS property (e.g. -Dsolr.max.booleanClauses=2000)

Hope this helps.

Mathew

On Tue, Sep 17, 2024 at 9:33 AM Thorsten Heit <th...@gmx.de.invalid> wrote:

> Hi all,
>
> I'm using solrj to search in Solr for documents that contain text that
> either starts with, ends with or contains user-defined input. The query
> actually has the following format:
>
> {!complexphrase inOrder=true}"<phrase>"~0
>
> with a "*" at the beginning and/or end of <phrase>, depending on what /
> how should be searched. When I test the query in the web UI I'm getting
> the following error:
>
> {
>    "responseHeader":{
>      "status":500,
>      "QTime":4,
>      "params":{
>        "q":"{!complexphrase inOrder=true}\"*1111 222222 33 4*\"~0",
>        "indent":"true",
>        "fl":"id,resourcename",
>        "start":"0",
>        "q.op":"AND",
>        "sort":"id asc",
>        "rows":"10000",
>        "useParams":"",
>        "_":"1726564406584"
>      }
>    },
>    "error":{
>      "msg":"maxClauseCount is set to 1024",
>      "trace":"org.apache.lucene.search.IndexSearcher$TooManyClauses:
> maxClauseCount is set to 1024\n\tat
>
> org.apache.lucene.search.ScoringRewrite$1.checkMaxClauseCount(ScoringRewrite.java:76)\n\tat
>
> org.apache.lucene.search.ScoringRewrite$ParallelArraysTermCollector.collect(ScoringRewrite.java:160)\n\tat
>
> org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:66)\n\tat
>
> org.apache.lucene.search.ScoringRewrite.rewrite(ScoringRewrite.java:107)\n\tat
>
> org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:326)\n\tat
>
> org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:777)\n\tat
>
> org.apache.lucene.queryparser.complexPhrase.ComplexPhraseQueryParser$ComplexPhraseQuery.rewrite(ComplexPhraseQueryParser.java:286)\n\tat
>
> org.apache.lucene.search.ConstantScoreQuery.rewrite(ConstantScoreQuery.java:44)\n\tat
>
> org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:777)\n\tat
>
> org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:791)\n\tat
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:559)\n\tat
>
> org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:276)\n\tat
>
> org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1932)\n\tat
>
> org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1729)\n\tat
>
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:726)\n\tat
>
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:721)\n\tat
>
> org.apache.solr.handler.component.QueryComponent.doProcessUngroupedSearch(QueryComponent.java:1690)\n\tat
>
> org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:432)\n\tat
>
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:456)\n\tat
>
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226)\n\tat
> org.apache.solr.core.SolrCore.execute(SolrCore.java:2880)\n\tat
>
> org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:890)\n\tat
> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:576)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:251)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:208)\n\tat
>
> org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:243)\n\tat
>
> org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:213)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:202)\n\tat
>
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:184)\n\tat
>
> org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)\n\tat
>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)\n\tat
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1580)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)\n\tat
>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)\n\tat
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1553)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)\n\tat
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)\n\tat
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)\n\tat
>
> org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:228)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
>
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:301)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
>
> org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)\n\tat
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
> org.eclipse.jetty.server.Server.handle(Server.java:563)\n\tat
>
> org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)\n\tat
> org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)\n\tat
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)\n\tat
> org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:461)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:193)\n\tat
>
> org.eclipse.jetty.http2.HTTP2Connection.produce(HTTP2Connection.java:208)\n\tat
>
> org.eclipse.jetty.http2.HTTP2Connection.onFillable(HTTP2Connection.java:155)\n\tat
>
> org.eclipse.jetty.http2.HTTP2Connection$FillableCallback.succeeded(HTTP2Connection.java:450)\n\tat
> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)\n\tat
>
> org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:558)\n\tat
>
> org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:379)\n\tat
>
> org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:146)\n\tat
> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)\n\tat
> org.eclipse.jetty.io
> .SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)\n\tat
>
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)\n\tat
>
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)\n\tat
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)\n\tat
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)\n\tat
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)\n\tat
> java.base/java.lang.Thread.run(Thread.java:1583)\n",
>      "code":500
>    }
> }
>
> Can someone tell me what is causing this error? I expected a response
> with 0 docs found...
>
> What puzzles me is that when I replace the trailing 4* in the query by
> another decimal number, it works:
>
> {
>    "responseHeader":{
>      "status":0,
>      "QTime":6,
>      "params":{
>        "q":"{!complexphrase inOrder=true}\"*1111 222222 33 3*\"~0",
>        "indent":"true",
>        "fl":"id,resourcename",
>        "start":"0",
>        "q.op":"AND",
>        "sort":"id asc",
>        "rows":"10000",
>        "useParams":"",
>        "_":"1726574210381"
>      }
>    },
>    "response":{
>      "numFound":0,
>      "start":0,
>      "numFoundExact":true,
>      "docs":[ ]
>    }
> }
>
>
> Is my query perhaps completely wrong?
>
>
>
> Environment:
> * Solr 9.7.0 as single instance, i.e. no Solr cloud
> * Java 21 on Ubuntu 24.04
>
> The core I'm using was created from the config set
> "sample_techproduct_configs"
>
>
>
>
> Best regards
>
> Thorsten
>

Reply via email to