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

add hl.q parameter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.4
    • 3.5, 4.0-ALPHA
    • highlighter
    • None

    Description

      If hl.q parameter is set, HighlightComponent uses it rather than q.

      Use case:

      You search "PC" with highlight and facet capability:

      q=PC
      &facet=on&facet.field=maker&facet.field=something
      &hl=on&hl.fl=desc
      

      You get a lot of results with snippets (term "PC" highlighted in desc field). Then you click a link "maker:DELL(50)" to narrow the result:

      q=PC
      &facet=on&facet.field=something
      &fq=maker:DELL
      &hl=on&hl.fl=desc
      

      You'll get narrowed result with term "PC" highlighted snippets. But, sometimes I'd like to see "DELL" to be highlighted as well, because I clicked "DELL". In this case, hl.q can be used:

      q=PC
      &facet=on&facet.field=something
      &fq=maker:DELL
      &hl=on&hl.fl=desc&*hl.q=PC+maker:DELL*
      

      Note that hl.requireFieldMatch should be false (false is default) in this scenario.

      Attachments

        1. SOLR-1926.patch
          2 kB
          Koji Sekiguchi
        2. SOLR-1926.patch
          5 kB
          Koji Sekiguchi
        3. SOLR-1926.patch
          7 kB
          Koji Sekiguchi
        4. SOLR-1926.patch
          5 kB
          Koji Sekiguchi
        5. SOLR-1926.patch
          5 kB
          Koji Sekiguchi

        Issue Links

          Activity

            People

              koji Koji Sekiguchi
              koji Koji Sekiguchi
              Votes:
              7 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: