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 2016/05/05 06:54:20 UTC

Can Highlighting and MoreLikeThis works together in same requestHandler?

Hi,

I'm finding out if we could possibly implement highlighting and
MoreLikeThis (MLT) function in the same requestHandler.

I understand that highlighting uses the normal SearchHandler, while MLT
uses MoreLikeThisHandler, and reach requestHandler can only have one
handler. For this case, we have to implement two different requestHandler,
and when user does a search, we have to send two different queries to Solr.

Is there anyway which we can combine the two together, so that when user
does a search, the same query can give both the highlight and MLT results?

I'm using Solr 5.4.0.

Regards,
Edwin

Re: Can Highlighting and MoreLikeThis works together in same requestHandler?

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
Does anyone knows if this configuration for the MoreLikeThisHandler will
actually work for the highlighting? I tried but it cannot work, although
from this conversion in the link below, it says that it can work.
http://grokbase.com/t/lucene/solr-user/094v8xm8h6/term-highlighting-with-morelikethishandler

   <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" >
<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="defType">edismax</str>
<str name="fl">id, score</str>

<str name="mlt.qf">
subject^10.0 content^20.0
</str>
<str name="df">content</str>
<str name="mlt.fl">subject content</str>
<str name="mlt.mintf">2</str>
                        <str name="mlt.mindf">5</str>
<str name="mlt.minwl">3</str>
<str name="mlt.maxqt">25</str>
<str name="mlt.count">10</str>
<str name="mlt.boost">false</str>
<str name="mlt.interestingTerms">details</str>
<str name="hl">true</str>
        <str name="hl.fl">id, subject, content, author, tag</str>
        <str name="hl.highlightMultiTerm">true</str>
        <str name="hl.preserveMulti">true</str>
        <str name="hl.fragsize">200</str>
  <str name="hl.maxAnalyzedChars">100000</str>
  <str name="hl.usePhraseHighlighter">true</str>
</lst>
</requestHandler>

Regards,
Edwin

On 5 May 2016 at 14:54, Zheng Lin Edwin Yeo <ed...@gmail.com> wrote:

> Hi,
>
> I'm finding out if we could possibly implement highlighting and
> MoreLikeThis (MLT) function in the same requestHandler.
>
> I understand that highlighting uses the normal SearchHandler, while MLT
> uses MoreLikeThisHandler, and reach requestHandler can only have one
> handler. For this case, we have to implement two different requestHandler,
> and when user does a search, we have to send two different queries to Solr.
>
> Is there anyway which we can combine the two together, so that when user
> does a search, the same query can give both the highlight and MLT results?
>
> I'm using Solr 5.4.0.
>
> Regards,
> Edwin
>