I have a problem related to highlighting multivalue field in Solr response. How can i highlight multivalue field which matched with my solr filter query? Below is the kind of my document,
<doc>
<str name="id">CAID_332_1003</str>
<arr name="lang_spec_labels">
<str>1_Label for UK</str>
<str>2_Label for US</str>
<str>4_Label for FR</str>
</arr>
</doc>
#My solr config details
<requestHandler name="/select" class="solr.StandardRequestHandler">
<lst name="defaults">
<str name="hl">on</str>
<str name="hl.fl">lang_spec_labels</str>
<str name="hl.encoder">html</str>
<bool name="hl.preserveMulti">false</bool>
<bool name="hl.useFastVectorHighlighter">true</bool>
<str name="f.lang_spec_labels.hl.fragsize">100</str>
<str name="f.lang_spec_labels.hl.alternateField">lang_spec_labels</str>
<str name="f.lang_spec_labels.hl.maxAlternateFieldLength">750</str>
<str name="hl.bs.type">SENTENCE</str>
</lst>
</requestHandler>
<searchComponent class="solr.HighlightComponent" name="highlight">
<highlighting class="org.apache.solr.highlight.PostingsSolrHighlighter">
<fragmentsBuilder name="default" default="true" class="solr.highlight.ScoreOrderFragmentsBuilder">
<lst name="defaults">
<str name="hl.multiValuedSeparatorChar">##</str>
</lst>
</fragmentsBuilder>
<encoder name="html" class="solr.highlight.HtmlEncoder" />
<formatter name="html"
default="true"
class="solr.highlight.HtmlFormatter">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
<str name="hl.simple.post"><![CDATA[</em>]]></str>
</lst>
</formatter>
</highlighting>
</searchComponent>
My Solr query like q=lang_spec_labels:(1_*)
My Solr Response
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">7</int>
</lst>
<result name="response" numFound="1" start="0">
<doc>
<arr name="lang_spec_labels">
<str>1_Label for UK</str>
<str>2_Label for US</str>
<str>4_Label for FR</str>
</arr></doc>
</result>
<lst name="highlighting">
<lst name="CAID_332_1003">
<arr name="lang_spec_labels">
<str>1_Label for UK 2_Label for US 4_Label for FR</str>
</arr>
</lst>
</lst>
Now querying with CITIES:*DEL*
, the solr highlighted response should returns only those cities which contains DEL in its word. How can i achieve this?
Is there any idea or suggestions about how to sort out this?
Looking for positive response from all of you solr geeks...
Thanks in advance for your support.
Regards, Ashish Mishra