Solr
  1. Solr
  2. SOLR-6573

Query elevation fails when localParams are used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.10.1
    • Fix Version/s: 4.10.2, 5.0, 6.0
    • Component/s: search
    • Labels:
      None

      Description

      Elevation does not work when localParams are specified.
      In example collection1 shipped with Solr query like this one

      http://localhost:8983/solr/collection1/elevate?q=ipod&fl=id,title,[elevated]

      properly returns elevated documents on top.

      If localParams are specified e.g.

      {!q.op=AND}

      in query like

      http://localhost:8983/solr/collection1/elevate?q=\{!q.op=AND\}ipod&fl=id,title,[elevated]

      documents are not elevated anymore.

      1. SOLR-6573.patch
        3 kB
        Jan Høydahl
      2. SOLR-6573.patch
        3 kB
        Jan Høydahl

        Activity

        Hide
        Jan Høydahl added a comment -

        Attaching patch with test case and quick fix, stripping localParam from query before evaluating against Elevation dictionary

        Show
        Jan Høydahl added a comment - Attaching patch with test case and quick fix, stripping localParam from query before evaluating against Elevation dictionary
        Hide
        Liwiusz Ociepa added a comment -

        Please include this fix in 4.10.2.

        Show
        Liwiusz Ociepa added a comment - Please include this fix in 4.10.2.
        Hide
        Jan Høydahl added a comment -

        Liwiusz Ociepa, have you tested the patch? If you have the chance, please do and give feedback.

        Also appreciate quick review from another committer. Looked for some existing utility class for parsing LocalParams, but could only find one to parse the details from a localParam, not anything to throw it away if found...

        Show
        Jan Høydahl added a comment - Liwiusz Ociepa , have you tested the patch? If you have the chance, please do and give feedback. Also appreciate quick review from another committer. Looked for some existing utility class for parsing LocalParams, but could only find one to parse the details from a localParam, not anything to throw it away if found...
        Hide
        Liwiusz Ociepa added a comment - - edited

        Yes - I've tested patch on example collection1 and results for query provided by Radek are ok with that fix (after removing backslashes added by Jira).

        edit: I patched 4.10.1

        Show
        Liwiusz Ociepa added a comment - - edited Yes - I've tested patch on example collection1 and results for query provided by Radek are ok with that fix (after removing backslashes added by Jira). edit: I patched 4.10.1
        Hide
        ASF subversion and git services added a comment -

        Commit 1633223 from janhoy@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1633223 ]

        SOLR-6573: QueryElevationComponent now works with localParams in the query

        Show
        ASF subversion and git services added a comment - Commit 1633223 from janhoy@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1633223 ] SOLR-6573 : QueryElevationComponent now works with localParams in the query
        Hide
        ASF subversion and git services added a comment -

        Commit 1633239 from janhoy@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1633239 ]

        SOLR-6573: QueryElevationComponent now works with localParams in the query - backport from trunk

        Show
        ASF subversion and git services added a comment - Commit 1633239 from janhoy@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1633239 ] SOLR-6573 : QueryElevationComponent now works with localParams in the query - backport from trunk
        Hide
        Jan Høydahl added a comment -

        Good comment from Chris Hostetter (Unused) about the case where people explicitly use localParam "v" in the query, e.g.:

        q={!lucene q.op=AND v=$qq}&qq=foo

        Then this patch will not help. Will leave this issue open and explore hoss' suggestion from the mailing list about getting the query from the ResponseBuilder.

        Show
        Jan Høydahl added a comment - Good comment from Chris Hostetter (Unused) about the case where people explicitly use localParam "v" in the query, e.g.: q={!lucene q.op=AND v=$qq}&qq=foo Then this patch will not help. Will leave this issue open and explore hoss' suggestion from the mailing list about getting the query from the ResponseBuilder.
        Hide
        ASF subversion and git services added a comment -

        Commit 1633395 from janhoy@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1633395 ]

        SOLR-6573: Updated after comments from Hoss, now also supports value parsed from localParam "v=", using rb.getQparser().getLocalParams()

        Show
        ASF subversion and git services added a comment - Commit 1633395 from janhoy@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1633395 ] SOLR-6573 : Updated after comments from Hoss, now also supports value parsed from localParam "v=", using rb.getQparser().getLocalParams()
        Hide
        ASF subversion and git services added a comment -

        Commit 1633402 from janhoy@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1633402 ]

        SOLR-6573: Updated after comments from Hoss, now also supports value parsed from localParam "v=", using rb.getQparser().getLocalParams()

        Show
        ASF subversion and git services added a comment - Commit 1633402 from janhoy@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1633402 ] SOLR-6573 : Updated after comments from Hoss, now also supports value parsed from localParam "v=", using rb.getQparser().getLocalParams()
        Hide
        ASF subversion and git services added a comment -

        Commit 1633446 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10'
        [ https://svn.apache.org/r1633446 ]

        SOLR-6573: QueryElevationComponent now works with localParams in the query - backport from trunk

        Show
        ASF subversion and git services added a comment - Commit 1633446 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1633446 ] SOLR-6573 : QueryElevationComponent now works with localParams in the query - backport from trunk
        Hide
        Sheri Watkins added a comment -

        Will this fix be included in the 4.10.2 version?

        Show
        Sheri Watkins added a comment - Will this fix be included in the 4.10.2 version?
        Hide
        Jan Høydahl added a comment -

        Yes, this is now included in the (possible) 4.10.2 release

        Show
        Jan Høydahl added a comment - Yes, this is now included in the (possible) 4.10.2 release

          People

          • Assignee:
            Jan Høydahl
            Reporter:
            Radek Urbas
          • Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development