Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11432

Query Elevation breaks collection aliasing under certain conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.6.1
    • None
    • None
    • SolrCloud 6.6.1, Centos 7

    Description

      I have two collections: "intranet" and "mysite.tld". I created an alias for both of these:

      {"collection":{"all":"mysite.tld,intranet"}}
      

      Both collections have query elevation enabled, with differing contents in elevate.xml.

      When I search the "all" alias with any old query, it works fine:

      $ curl -s 'http://192.168.11.10:8983/solr/all/select?q=something&wt=json&qf=content' | jq .response.numFound
      20
      

      When I search with a query which matches the elevate.xml in one of the collections but not both, I get this error:

      $ curl -s 'http://192.168.11.10:8983/solr/all/select?q=tiedekunta&wt=json&qf=content' | jq .
      {
        "responseHeader": {
          "zkConnected": true,
          "status": 500,
          "QTime": 28,
          "params": {
            "q": "tiedekunta",
            "qf": "content",
            "wt": "json"
          }
        },
        "error": {
          "trace": "java.lang.NullPointerException\n\tat org.apache.solr.handler.component.QueryComponent.unmarshalSortValues(QueryComponent.java:1227)\n\tat org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1075)\n\tat org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:775)\n\tat org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:754)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:429)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)\n\tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\n\tat org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:534)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\n\tat org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)\n\tat java.lang.Thread.run(Thread.java:748)\n",
          "code": 500
        }
      }
      

      If I add enableElevation=false, it works fine:

      $ curl -s 'http://192.168.11.10:8983/solr/all/select?q=tiedekunta&wt=json&qf=content&enableElevation=false' | jq .response.numFound
      170
      

      Similarly, if I search for the same word in either of the collections themselves, it works fine:

      $ curl -s 'http://192.168.11.10:8983/solr/intranet/select?q=tiedekunta&wt=json&qf=content' | jq .response.numFound
      100
      $ curl -s 'http://192.168.11.10:8983/solr/mysite.tld/select?q=tiedekunta&wt=json&qf=content' | jq .response.numFound
      71
      

      And finally, if I search the "all" alias for a word which is found in both collections' elevate.xml, it works fine:

      $ curl -s 'http://192.168.11.10:8983/solr/all/select?q=avoin&wt=json&qf=content' | jq .
      {
        "responseHeader": {
          "zkConnected": true,
          "status": 0,
          "QTime": 46,
          "params": {
            "q": "avoin",
            "qf": "content",
            "wt": "json"
          }
        },
        "response": {
          "numFound": 300,
          "start": 0,
          "maxScore": 5.8714366,
          "docs": [
            {
              "url": REDACTED,
              "contentLength": 62564,
              "mimetype": "text/html",
              "id": REDACTED,
              "[elevated]": true
            },
            {
              "url": REDACTED,
              "contentLength": 38354,
              "mimetype": "text/html",
              "id": REDACTED,
              "[elevated]": false
            },
       --SNIP--
      

      To conclude: Query Elevation breaks collection aliasing (atleast in cloud mode) when the queried string is a hit in one of the aliased collections' elevate.xml but not all of them.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ronjakoi Ronja Koistinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: