[ 
https://issues.apache.org/jira/browse/SOLR-17870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated SOLR-17870:
----------------------------------
    Labels: pull-request-available  (was: )

> UnsupportedOperationException in SpellCheckComponent when Sorting Collations
> ----------------------------------------------------------------------------
>
>                 Key: SOLR-17870
>                 URL: https://issues.apache.org/jira/browse/SOLR-17870
>             Project: Solr
>          Issue Type: Bug
>          Components: spellchecker
>    Affects Versions: 9.6.1
>            Reporter: Puneet Sharma
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2025-08-20-11-34-37-839.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When executing a search query with spell checking enabled 
> ({{{}spellcheck=true{}}}), Solr throws a 
> {{{}java.lang.UnsupportedOperationException{}}}. This occurs because the 
> {{SpellCheckComponent}} attempts to sort an immutable list of spellcheck 
> collations. 
> Environment:
> Solr version - 9.6.1
> Steps to reproduce
>  # Set up a SolrCloud collection with the {{SpellCheckComponent}} configured 
> in the request handler (e.g., the default {{/browse}} handler).
>  # Index documents that would allow the spell checker to generate suggestions 
> (collations).
>  # Execute a search query containing a typo and the parameter 
> {{spellcheck=true}}
> {{Query:}}
> {{/browse?q=xbox+seris+s*&spellcheck=true&..}}
> Server Error:
> Time allowed to handle this request exceeded
> {code:java}
> org.apache.solr.client.solrj.SolrServerException: Time allowed to handle this 
> request exceeded \tat 
> org.apache.solr.client.solrj.impl.LBSolrClient$ServerIterator.nextOrError(LBSolrClient.java:296)
>  \tat 
> org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:455) 
> \tat 
> org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1193)
>  \tat 
> org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:892)
>  \tat 
> org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:820)
>  \tat org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:255) 
> \tat org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:956) \tat 
> org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:971) {code}
> UnsupportedOperationException
> {code:java}
> Error from server at 
> http://{host}:8983/solr/retailCollection5s_shard4_replica_p119/browse: 
> java.lang.UnsupportedOperationException \tat 
> java.base/java.util.ImmutableCollections.uoe(ImmutableCollections.java:142) 
> \tat 
> java.base/java.util.ImmutableCollections$AbstractImmutableList.sort(ImmutableCollections.java:263)
>  \tat java.base/java.util.Collections.sort(Collections.java:145) \tat 
> org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:326)
>  \tat 
> org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:229)
>  \tat 
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:465)
>  \tat 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226)
>  \tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2886) \tat 
> org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:910)
>  \tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:596) \tat 
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:262)
>  \tat 
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:219)
>  \tat 
> org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:249)
>  \tat 
> org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:215) 
> \tat 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)
>  \tat 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)
>  \tat org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210) 
> \tat 
> org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
>  \tat 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527) 
> \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) 
> \tat 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598) 
> \tat 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
>  \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
>  \tat 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1580)
>  \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
>  \tat 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
>  \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
>  \tat 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484) 
> \tat 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1553)
>  \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
>  \tat 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
>  \tat 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) 
> \tat 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
>  \tat 
> org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:228)
>  \tat 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141)
>  \tat 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
>  \tat 
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:301)
>  \tat 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
>  \tat 
> org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)
>  \tat 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
>  \tat org.eclipse.jetty.server.Server.handle(Server.java:563) \tat 
> org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
>  \tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753) 
> \tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501) \tat 
> org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:461) \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:193)
>  \tat 
> org.eclipse.jetty.http2.HTTP2Connection.produce(HTTP2Connection.java:208) 
> \tat 
> org.eclipse.jetty.http2.HTTP2Connection.onFillable(HTTP2Connection.java:155) 
> \tat 
> org.eclipse.jetty.http2.HTTP2Connection$FillableCallback.succeeded(HTTP2Connection.java:450)
>  \tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) \tat 
> org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
>  \tat 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)
>  \tat 
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
>  \tat 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
>  \tat 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
>  \tat 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
>  \tat java.base/java.lang.Thread.run(Thread.java:1583)  \tat 
> org.apache.solr.client.solrj.impl.HttpSolrClientBase.processErrorsAndResponse(HttpSolrClientBase.java:297)
>  \tat 
> org.apache.solr.client.solrj.impl.Http2SolrClient.processErrorsAndResponse(Http2SolrClient.java:570)
>  \tat 
> org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:526)
>  \tat 
> org.apache.solr.client.solrj.impl.LBSolrClient.doRequest(LBSolrClient.java:495)
>  \tat 
> org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:458) 
> \t... 24 common frames omitted {code}
> !image-2025-08-20-11-34-37-839.png|width=596,height=79!
> SpellCheckCollator returns the Immutable List when queryLimits exceeded
> Ref Jira: https://issues.apache.org/jira/browse/SOLR-17172



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to