Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The Highlighter Component does not currently expose the snippet character offsets nor the score. There is a TODO in DefaultSolrHighlighter indicating the intention to add this eventually. This information is needed when doing highlighting on external content. The data is there so its pretty easy to output it in some way. The challenge is deciding on the output and its ramifications on backwards compatibility. The current highlighter component response structure doesn't lend itself to adding any new data, unfortunately. I wish the original implementer had some foresight. Unfortunately all the highlighting tests assume this structure. Here is a snippet of the current response structure in Solr's sample data searching for "sdram" for reference:
<lst name="highlighting"> <lst name="VS1GB400C3"> <arr name="text"> <str>CORSAIR ValueSelect 1GB 184-Pin DDR <em>SDRAM</em> Unbuffered DDR 400 (PC 3200) System Memory - Retail</str> </arr> </lst> </lst>
Perhaps as a little hack, we introduce a pseudo field called text_startCharOffset which is the concatenation of the matching field and "_startCharOffset". This would be an array of ints. Likewise, there would be another array for endCharOffset and score.
Thoughts?
Attachments
Attachments
Issue Links
- is related to
-
SOLR-1397 It should be possible to highlight external text
- Open
- relates to
-
SOLR-4722 Highlighter which generates a list of query term position(s) for each item in a list of documents, or returns null if highlighting is disabled.
- Open
-
SOLR-11801 support customisation of the "highlighting" query response element
- Closed