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

Highlighting is not working with docValues only String field

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.2.1
    • Fix Version/s: None
    • Component/s: highlighter
    • Labels:
      None

      Description

      Highlighting is not working with docValues only String field.  Need to check SortableTextField as mentioned by Erick Erickson

      Schema:
      <schema name="core" version="1.6">
        <uniqueKey>id</uniqueKey>
        <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
        <field name="id" type="string" docValues="true" indexed="true" required="true"/>
        <field name="name" type="string" docValues="false" indexed="true" stored="true"/>
        <field name="name1" type="string" docValues="true" indexed="true" stored="false"/>
        <copyField source="name" dest="name1"/>
      </schema>

      Data:
      [

      {"id":1,"name":"Testing line 1"}

      ,

      {"id":2,"name":"Testing line 2"}

      ,

      {"id":3,"name":"Testing line 3"}

      ]

      Query:
      http://localhost:8983/solr/test/select?q=Testing*&df=name&hl=true&hl.fl=name,name1

      Response:
      {"response":{"numFound":3,"start":0,"docs":[

      {"id":"1","name":"Testing line 1","name1":"Testing line 1"}

      ,{"id":"2","name":"Testing line 2","name1":"Testing line 2"},{"id":"3","name":"Testing line 3","name1":"Testing line 3"}]},"highlighting":{"1":

      {"name":["<em>Testing line 1</em>"]}

      ,"2":

      {"name":["<em>Testing line 2</em>"]}

      ,"3":

      {"name":["<em>Testing line 3</em>"]}

      }}

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mrkarthik Karthik Ramachandran
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: