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 Zheng Lin Edwin Yeo <ed...@gmail.com> on 2015/10/07 11:46:01 UTC

Highlighting tag is not showing occasionally

Hi,

Has anyone face the problem of when using highlighting, sometimes there are
results which are returned, but there is no highlighting to the result (ie:
no <em> tag).

I found that there is a match in another field which I did not include in
my hl.fl parameters when I do fl=*, but that same word acutally does appear
in content.

Would like to find out, why sometimes there is a match in content, but it
is not highlighted (the word is not in the stopword list)? Did I make any
mistakes in my configuration?

I've include my highlighting request handler from solrconfig.xml here.

<requestHandler name="/highlight" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="echoParams">explicit</str>
        <int name="rows">10</int>
        <str name="wt">json</str>
        <str name="indent">true</str>
<str name="df">text</str>
<str name="fl">id, title, content_type, last_modified, url, score </str>

<str name="hl">on</str>
        <str name="hl.fl">id, title, content, author, tag</str>
  <str name="hl.highlightMultiTerm">true</str>
        <str name="hl.preserveMulti">true</str>
        <str name="hl.encoder">html</str>
<str name="hl.fragsize">200</str>

<str name="group">true</str>
<str name="group.field">signature</str>
<str name="group.main">true</str>
<str name="group.cache.percent">100</str>
    </lst>
</requestHandler>


Regards,
Edwin

Re: Highlighting tag is not showing occasionally

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
I found that it could be due to the EdgeNGramFilterFactory. This issue
didn't happen if I did not apply the EdgeNGramFilterFactory filter for my
fieldType.

But does anyone knows why using the EdgeNGramFilterFactory will cause this
problem?

Regards,
Edwin


On 7 October 2015 at 17:46, Zheng Lin Edwin Yeo <ed...@gmail.com>
wrote:

> Hi,
>
> Has anyone face the problem of when using highlighting, sometimes there
> are results which are returned, but there is no highlighting to the result
> (ie: no <em> tag).
>
> I found that there is a match in another field which I did not include in
> my hl.fl parameters when I do fl=*, but that same word acutally does appear
> in content.
>
> Would like to find out, why sometimes there is a match in content, but it
> is not highlighted (the word is not in the stopword list)? Did I make any
> mistakes in my configuration?
>
> I've include my highlighting request handler from solrconfig.xml here.
>
> <requestHandler name="/highlight" class="solr.SearchHandler">
>     <lst name="defaults">
>         <str name="echoParams">explicit</str>
>         <int name="rows">10</int>
>         <str name="wt">json</str>
>         <str name="indent">true</str>
> <str name="df">text</str>
> <str name="fl">id, title, content_type, last_modified, url, score </str>
>
> <str name="hl">on</str>
>         <str name="hl.fl">id, title, content, author, tag</str>
>   <str name="hl.highlightMultiTerm">true</str>
>         <str name="hl.preserveMulti">true</str>
>         <str name="hl.encoder">html</str>
> <str name="hl.fragsize">200</str>
>
> <str name="group">true</str>
> <str name="group.field">signature</str>
> <str name="group.main">true</str>
> <str name="group.cache.percent">100</str>
>     </lst>
> </requestHandler>
>
>
> Regards,
> Edwin
>