You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Val Minyaylo <vm...@centraldesktop.com> on 2011/08/25 19:32:43 UTC
Highlight on alternateField
Hi there,
I am trying to utilize highlighting alternateField and can't get
highlights on the results from targeted fields. Is this expected
behavior or am I understanding alternateFields wrong?
schema.xml:
<field name="description" type="text" indexed="true" stored="false"
multiValued="true" termVectors="true" termPositions="true"
termOffsets="true"/>
<field name="description_highlighting" type="string" indexed="true"
stored="true" termVectors="true" termPositions="true" termOffsets="true"/>
<copyField source="description" dest="description_highlighting"
maxChars="2500"/>
solrconfig.xml:
<str name="f.description.hl.alternateField">description_highlighting</str>
<str name="f.description.hl.alternateFieldLen">100</str>
Re: Highlight on alternateField
Posted by Val Minyaylo <vm...@centraldesktop.com>.
Thanks a lot Koji.
On 8/25/2011 5:04 PM, Koji Sekiguchi wrote:
> (11/08/26 2:32), Val Minyaylo wrote:
>> Hi there,
>> I am trying to utilize highlighting alternateField and can't get
>> highlights on the results from
>> targeted fields. Is this expected behavior or am I understanding
>> alternateFields wrong?
>
> Yes, it is expected behavior.
>
>> solrconfig.xml:
>> <str
>> name="f.description.hl.alternateField">description_highlighting</str>
>> <str name="f.description.hl.alternateFieldLen">100</str>
>
> With &hl=on&hl.fl=description parameters, you can get the first 100
> chars of
> the (raw) stored description_highlighting field value if highlighter
> cannot generate
> snippets on description field for some reason.
>
> koji
Re: Highlight on alternateField
Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(11/08/26 2:32), Val Minyaylo wrote:
> Hi there,
> I am trying to utilize highlighting alternateField and can't get highlights on the results from
> targeted fields. Is this expected behavior or am I understanding alternateFields wrong?
Yes, it is expected behavior.
> solrconfig.xml:
> <str name="f.description.hl.alternateField">description_highlighting</str>
> <str name="f.description.hl.alternateFieldLen">100</str>
With &hl=on&hl.fl=description parameters, you can get the first 100 chars of
the (raw) stored description_highlighting field value if highlighter cannot generate
snippets on description field for some reason.
koji
--
Check out "Query Log Visualizer" for Apache Solr
http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html
http://www.rondhuit.com/en/