3

I am trying to use a simple query in the SOLR cloud with 3 shards in my collection with basic authentication enabled. Everything is working fine in the cloud but when I am using more like this ( MLT ) query parser there is an issue.

The id used XXXXX is a valid id and present in the index SOLR version : 8.9.0 Query: http://localhost:8983/solr/my_collection/select?q={!mlt+qf%3Dtext}XXXXX&start=0&rows=7&fl=id,text

The query fails even on valid document id with the below error in the SOLR logs:

Error completing MLT request. Could not fetch document with id [XXXXX]
at org.apache.solr.search.mlt.CloudMLTQParser.parse(CloudMLTQParser.java:68)
at org.apache.solr.search.QParser.getQuery(QParser.java:174)
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:162)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:334)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:216)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2637)
at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:794)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:567)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:357)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
at java.lang.Thread.run(Thread.java:748)
Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Nishkarsh Dixit
  • 137
  • 1
  • 10
  • How are configured the 'text' and 'id' (if id is the uniqueKey) fields ? Note that MLT requires the fields used in mlt.qf and the uniqueKey to be stored in order to work properly. Also, the document id is the document’s uniqueKey value and not the Lucene internal document id. – EricLavault Dec 03 '21 at 14:46
  • Yes id here is the unique key and both text and unique key i.e id fields used here are stored fields. – Nishkarsh Dixit Dec 04 '21 at 15:03
  • Ok, what happens with other documents (id) / when you change the qf field to another stored field (something like title, name...) ? Do you get the same behavior by using the `/mlt` request handler instead of `/select` ? – EricLavault Dec 04 '21 at 15:51
  • I tried with other document ids and other stored fields the error remains the same. It works with /mlt when I pass the text in the stream.body but the problem there is that /mlt is limited to local shards only I won't get the result from all the shards. – Nishkarsh Dixit Dec 05 '21 at 08:00
  • the answer is here: https://lists.apache.org/thread/y7shblrwkhvdcw13ntk811gv435fqlq1 Internally MLT query parser uses the get handler to obtain the seed document. The get handler will fail if the value of the document id is not the same as the routing key. – jetnet Nov 17 '22 at 17:51

0 Answers0