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 Yoni Amir <Yo...@actimize.com> on 2012/08/05 09:25:20 UTC

highlighting tint fields

Hello,
(sorry for the empty message earlier, that was by mistake)

I am experiencing a strange problem with highlighting. I have a simple configuration roughly as follows:

       <str name="defType">edismax</str>
       <str name="qf">all_text</str>
       ...
       <str name="hl">on</str>
       <str name="hl.fl">*</str>
       <bool name="hl.requireFieldMatch">false</bool>

I run the search on a single catch-all field called "all_text", and I want the highlighting to work on other fields in the document.
All the other fields that are meant to be highlighted are indexed and stored, and they are copied to all_text with the <copyField> directive.

This works fine for text fields, however if the field is of type tint or tdate Solr doesn't return any highlight information for them.
E.g., I have this field:

<field name="age" type="tint" indexed="true" stored="true" />

and:

<copyField source="age" dest="all_text" />

But no highlighting for it.

Thanks,
Yoni

Re: highlighting tint fields

Posted by Jan Høydahl <ja...@cominvent.com>.
Hi,

That is by design, you can only highlight text fields. The solution is to copy your "age" field to a "age_t" field and highlight on that instead.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

5. aug. 2012 kl. 09:25 skrev Yoni Amir <Yo...@actimize.com>:

> Hello,
> (sorry for the empty message earlier, that was by mistake)
> 
> I am experiencing a strange problem with highlighting. I have a simple configuration roughly as follows:
> 
>       <str name="defType">edismax</str>
>       <str name="qf">all_text</str>
>       ...
>       <str name="hl">on</str>
>       <str name="hl.fl">*</str>
>       <bool name="hl.requireFieldMatch">false</bool>
> 
> I run the search on a single catch-all field called "all_text", and I want the highlighting to work on other fields in the document.
> All the other fields that are meant to be highlighted are indexed and stored, and they are copied to all_text with the <copyField> directive.
> 
> This works fine for text fields, however if the field is of type tint or tdate Solr doesn't return any highlight information for them.
> E.g., I have this field:
> 
> <field name="age" type="tint" indexed="true" stored="true" />
> 
> and:
> 
> <copyField source="age" dest="all_text" />
> 
> But no highlighting for it.
> 
> Thanks,
> Yoni