[
https://issues.apache.org/jira/browse/SOLR-488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tomer Gabel updated SOLR-488:
-----------------------------
Attachment: linkfield.HighlightingUtils.patch
Patch to HighlightingUtils.java: adds a "link field" parameter which allows
highlight generation even when uniqueId is not defined in the schema.
> Solr does not generate highlights when uniqueId field is not defined in the
> schema
> ----------------------------------------------------------------------------------
>
> Key: SOLR-488
> URL: https://issues.apache.org/jira/browse/SOLR-488
> Project: Solr
> Issue Type: Improvement
> Components: highlighter
> Affects Versions: 1.2
> Environment: Windows Vista Business (x86, x64), latest Ubuntu server,
> Apache Tomcat 6.0.14
> Reporter: Tomer Gabel
> Attachments: linkfield.HighlightingUtils.patch
>
>
> Solr does not generate highlights when there is no uniqueId field defined in
> the schema. I believe the reason for this is that it's very difficult to
> modify or extend the XmlWriter behavior, which is why highlights reside in
> their own "section" in the response XML and subsequently need to be "linked"
> to their respective documents via the uniqueId field.
> Our schema does not define a uniqueId for various reasons but we still need
> highlights; the solution we came up with was to provide a user-definable
> "link field," which is the document field whose value resides in the {{<lst
> name="215">}} elements in the generated output. I will presently attach a
> patch which adds a "hl.link" query parameter, which takes a field name and
> uses that as the "link field." If the parameter is not specified the original
> behavior is used, so backwards compatibility is maintained.
> As an aside, we've found this technique to be useful because our custom
> handlers add a lot of information to each document, and the way the response
> writer is implemented makes it nigh impossible to add information to any
> specific document within the response. I should probably open an issue which
> calls to reimplement this aspect of Solr.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.