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

Problems with the spellcheck component running search with cursor

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.5.2, 5.6, 6.0.2, 6.1
    • Component/s: spellchecker
    • Labels:
      None

      Description

      I'm having some problems with the spellcheck component, specifically, running a search with cursors.

      When I run the following query:

      http://192.1.1.13:8983/solr/docs/search?q=insendio&shards.qt=/search&shards=192.1.1.14:8983/solr/docs,192.1.1.15:8983/solr/docs&fl=id&spellcheck=true&sort=score desc,id asc

      the following collations are returned
      <lst name="collations">
      <lst name="collation">
      <str name="collationQuery">incendio</str>
      <int name="hits">485</int>
      <lst name="misspellingsAndCorrections">
      <str name="insendio">incendio</str>
      </lst>
      </lst>
      </lst>

      Instead, when I try to run the same query but this time using cursors

      http://192.1.1.13:8983/solr/docs/search?q=insendio&shards.qt=/search&shards=192.1.1.14:8983/solr/docs,192.1.1.15:8983/solr/docs&fl=id&spellcheck=true&sort=score desc,id asc&cursorMark=*

      no collations are returned

      <bool name="correctlySpelled">false</bool><lst name="collations"/>

      and the server trace the following exception message.

      WARN - 2016-05-26 14:14:58.472; [docs shard2 core_node4 docs_shard2_replica1] org.apache.solr.spelling.SpellCheckCollator; Exception trying to re-query to check if a spell check possibility would return any hits.
      org.apache.solr.common.SolrException: Cursor functionality requires a sort containing a uniqueKey field tie breaker
      at org.apache.solr.search.CursorMark.<init>(CursorMark.java:93)
      at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:189)
      at org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:141)
      at org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:237)
      at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:202)
      at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:255)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:2064)
      at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:654)
      at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:450)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:227)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:196)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      at org.eclipseInstead.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:497)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745)

      1. SOLR-9165.patch
        3 kB
        James Dyer
      2. SOLR-9165.patch
        2 kB
        James Dyer

        Activity

        Hide
        jdyer James Dyer added a comment -

        Here's a failing unit test for this one: SOLR-9165.patch.

        Show
        jdyer James Dyer added a comment - Here's a failing unit test for this one: SOLR-9165.patch .
        Hide
        jdyer James Dyer added a comment -

        Here's a straightforward fix: don't request the cursorMark when testing the index for valid collations. SOLR-9165.patch.

        I'll commit to master and branch_6x shortly.

        Show
        jdyer James Dyer added a comment - Here's a straightforward fix: don't request the cursorMark when testing the index for valid collations. SOLR-9165.patch . I'll commit to master and branch_6x shortly.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 164128f977720acc408e88b595f8621bf9760b45 in lucene-solr's branch refs/heads/master from jdyer1
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=164128f ]

        SOLR-9165: disable "cursorMark" when testing for valid SpellCheck Collations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 164128f977720acc408e88b595f8621bf9760b45 in lucene-solr's branch refs/heads/master from jdyer1 [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=164128f ] SOLR-9165 : disable "cursorMark" when testing for valid SpellCheck Collations
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit f1f85e560f54371800a368aff801b7c24413ece6 in lucene-solr's branch refs/heads/branch_6x from jdyer1
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f1f85e5 ]

        SOLR-9165: disable "cursorMark" when testing for valid SpellCheck Collations

        Show
        jira-bot ASF subversion and git services added a comment - Commit f1f85e560f54371800a368aff801b7c24413ece6 in lucene-solr's branch refs/heads/branch_6x from jdyer1 [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f1f85e5 ] SOLR-9165 : disable "cursorMark" when testing for valid SpellCheck Collations
        Hide
        jdyer James Dyer added a comment -

        Yamileydis, thank you for reporting this.

        Show
        jdyer James Dyer added a comment - Yamileydis, thank you for reporting this.
        Hide
        steve_rowe Steve Rowe added a comment -

        Reopening to backport to 6.0.2, 5.6 and 5.5.2.

        Show
        steve_rowe Steve Rowe added a comment - Reopening to backport to 6.0.2, 5.6 and 5.5.2.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 845f57d16ad1b9f6b499d8597f2fb1edbd571474 in lucene-solr's branch refs/heads/branch_5_5 from jdyer1
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=845f57d ]

        SOLR-9165: disable "cursorMark" when testing for valid SpellCheck Collations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 845f57d16ad1b9f6b499d8597f2fb1edbd571474 in lucene-solr's branch refs/heads/branch_5_5 from jdyer1 [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=845f57d ] SOLR-9165 : disable "cursorMark" when testing for valid SpellCheck Collations
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit b4d81f784136b6c3fd19940055b812862baa99ca in lucene-solr's branch refs/heads/branch_5x from jdyer1
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b4d81f7 ]

        SOLR-9165: disable "cursorMark" when testing for valid SpellCheck Collations

        Show
        jira-bot ASF subversion and git services added a comment - Commit b4d81f784136b6c3fd19940055b812862baa99ca in lucene-solr's branch refs/heads/branch_5x from jdyer1 [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b4d81f7 ] SOLR-9165 : disable "cursorMark" when testing for valid SpellCheck Collations
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 7b79571d948365658e00f0bb431c082dedca1aaf in lucene-solr's branch refs/heads/branch_6_0 from jdyer1
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7b79571 ]

        SOLR-9165: disable "cursorMark" when testing for valid SpellCheck Collations

        Show
        jira-bot ASF subversion and git services added a comment - Commit 7b79571d948365658e00f0bb431c082dedca1aaf in lucene-solr's branch refs/heads/branch_6_0 from jdyer1 [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7b79571 ] SOLR-9165 : disable "cursorMark" when testing for valid SpellCheck Collations
        Hide
        steve_rowe Steve Rowe added a comment -

        Bulk close issues released with 5.5.2.

        Show
        steve_rowe Steve Rowe added a comment - Bulk close issues released with 5.5.2.

          People

          • Assignee:
            jdyer James Dyer
            Reporter:
            yami.veranes Yamileydis Veranes
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development