Solr
  1. Solr
  2. SOLR-5564

hl.maxAlternateFieldLength should apply to original field when fallback field does not exist

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6.1, 4.7, 6.0
    • Component/s: highlighter
    • Labels:
      None

      Description

      For a customer we use f.body.hl.alternateField=teaser&hl.maxAlternateFieldLength=100
      But some articles do not have the teaser field filled at all, so for queries that do not match the body, we get the full huge body returned in the frontend.

      If the highlighter has tried to fallback to the alternateField, then hl.maxAlternateFieldLength should always apply, even to text from the original field if alternateFIeld does not exist.

      1. SOLR-5564.patch
        2 kB
        Jan Høydahl

        Activity

        Hide
        Jan Høydahl added a comment -

        Here's a patch with testcase

        Show
        Jan Høydahl added a comment - Here's a patch with testcase
        Hide
        Jan Høydahl added a comment -

        I did not make it parameter driven, as I cannot see any cases where this is not the intended/wanted result? If someone can bless the patch I'll commit within a few days.

        Candidate for 4.6.1 ?

        Show
        Jan Høydahl added a comment - I did not make it parameter driven, as I cannot see any cases where this is not the intended/wanted result? If someone can bless the patch I'll commit within a few days. Candidate for 4.6.1 ?
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-5564: hl.maxAlternateFieldLength should apply to original field when fallback field does not exist

        Show
        ASF subversion and git services added a comment - Commit 1555035 from janhoy@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1555035 ] SOLR-5564 : hl.maxAlternateFieldLength should apply to original field when fallback field does not exist
        Hide
        ASF subversion and git services added a comment -

        Commit 1555036 from janhoy@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1555036 ]

        SOLR-5564: hl.maxAlternateFieldLength should apply to original field when fallback field does not exist (backport)

        Show
        ASF subversion and git services added a comment - Commit 1555036 from janhoy@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1555036 ] SOLR-5564 : hl.maxAlternateFieldLength should apply to original field when fallback field does not exist (backport)
        Hide
        Jan Høydahl added a comment -

        Committed and fixed from v4.6.1

        Show
        Jan Høydahl added a comment - Committed and fixed from v4.6.1
        Hide
        ASF subversion and git services added a comment -

        Commit 1555039 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_6'
        [ https://svn.apache.org/r1555039 ]

        SOLR-5564: hl.maxAlternateFieldLength should apply to original field when fallback field does not exist (backport)

        Show
        ASF subversion and git services added a comment - Commit 1555039 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_6' [ https://svn.apache.org/r1555039 ] SOLR-5564 : hl.maxAlternateFieldLength should apply to original field when fallback field does not exist (backport)

          People

          • Assignee:
            Jan Høydahl
            Reporter:
            Jan Høydahl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development