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

Preserve multi-value fields during hit highlighting

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Component/s: highlighter
    • Labels:
      None

      Description

      The behavior of the default Solr hit highlighter on multi-value fields is to only return the values that have a hit and sort them by score.

      This ticket supplies a patch that adds a new highlight parameter called "preserveMulti" which can be used on a feild by field basis to return all of the values in their original order. If this parameter is used, the values that have a hit are highlighted and the ones that do not contain a hit are returned un-highlighted.

      The "preserveMulti" parameter works with the default standard highlighter and follows the standard highlighting conventions.

      Sample usage for a field called "cat":

      f.cat.hl.preserveMulti=true

        Attachments

        1. SOLR-3897_snippets.patch
          3 kB
          Yonik Seeley
        2. SOLR-3897.patch
          5 kB
          Joel Bernstein
        3. SOLR-3897.patch
          4 kB
          Joel Bernstein

          Activity

            People

            • Assignee:
              yseeley@gmail.com Yonik Seeley
              Reporter:
              joel.bernstein Joel Bernstein
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: