Solr
  1. Solr
  2. SOLR-1624

Highlighter bug with MultiValued field + TermPositions optimization

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5, 3.1, 4.0-ALPHA
    • Component/s: highlighter
    • Labels:
      None

      Description

      When TermPositions are stored, then DefaultSolrHighlighter.doHighlighting(DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) currently initializes tstream only for the first value of a multi-valued field. (Subsequent times through the loop reinitialization is preempted by tots being non-null.) This means that the 2nd/3rd/etc. values are not considered for highlighting purposes, resulting in missed highlights.

      I'm attaching a patch with a test case to demonstrate the problem (testTermVecMultiValuedHighlight2), as well as a proposed fix. All highlighter tests pass with this applied. The patch should apply cleanly against the latest trunk.

      1. SOLR-1624.patch
        4 kB
        Chris Harris

        Activity

        Hide
        Yonik Seeley added a comment -

        Committed. Thanks Chris!

        Show
        Yonik Seeley added a comment - Committed. Thanks Chris!
        Hide
        Hoss Man added a comment -

        Correcting Fix Version based on CHANGES.txt, see this thread for more details...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Show
        Hoss Man added a comment - Correcting Fix Version based on CHANGES.txt, see this thread for more details... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Harris
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development