[ 
https://issues.apache.org/jira/browse/SOLR-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Endele updated SOLR-6782:
-------------------------------
    Attachment: SOLR-6782.patch

I'm not a Solr expert, but if I understand the code right, this can be fixed 
with a few lines.

Added a patch that addresses both issues. The request above now produces the 
following response:
{code}
  "highlighting": {
    "mydoc1": {
      "content": [
        "my highlighted content. "
      ]
    },
    "mydoc2": {
      "content": [
        "my highlighted content 2. "
      ]
    }
  },
{code}

Seems to work with {{hl.defaultSummary=true}}, too. Response:
{code}
  "highlighting": {
    "mydoc1": {
      "title": [
        "My Summary."
      ],
      "content": [
        "my highlighted content. "
      ]
    },
    "mydoc2": {
      "title": [
        "My Summary 2."
      ],
      "content": [
        "my highlighted content 2. "
      ]
    }
  },
{code}

> PostingsSolrHighlighter produces strange highlight results
> ----------------------------------------------------------
>
>                 Key: SOLR-6782
>                 URL: https://issues.apache.org/jira/browse/SOLR-6782
>             Project: Solr
>          Issue Type: Bug
>          Components: highlighter
>            Reporter: Simon Endele
>         Attachments: SOLR-6782.patch
>
>
> If {{hl.fl}} contains commas _and_ whitespaces, e.g. {{hl.fl=title, 
> content}}, the PostingsSolrHighlighter produces the following result:
> {code}
>   "highlighting": {
>     "mydoc1": {
>       "title": [],
>       "": [],
>       "content": [
>         "my highlighted content. "
>       ]
>     },
>     "mydoc2": {
>       "title": [],
>       "": [],
>       "content": [
>         "my highlighted content 2. "
>       ]
>     }
>   },
> {code}
> Two things:
> - The space followed by the comma leads to an empty field (or even a bunch in 
> case of longer field list).
> - Why is {{"title": [],}} included in the response (though 
> {{hl.defaultSummary}} is not set)?
> Tested with Solr 4.10.2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to