3
votes

I am trying to get the more-like-this query parser working on my test system. The test system has SOLR cloud 6.5.0 installed. The MLT handler is enabled with the following configuration:

<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
    <lst name="defaults">
        <str name="mlt.qf">search_text_st</str>
        <str name="mlt.fl">search_text_st</str>
        <int name="mlt.minwl">4</int>
        <int name="mlt.maxwl">18</int>
    </lst>
</requestHandler>

When I query for document similar to a specific document with the handler, I get expected results. For example:

http://localhost:8983/solr/MyCloud/mlt?q=id:123

The above query will return results:

"response":{"numFound":361,"start":0,"maxScore":113.24594,"docs":[...]}

However, when I try an equivalent query using the MLTQParser with {!mlt qf=search_text_st fl=search_text_st minwl=4 maxwl=18}123, I get no results:

http://localhost:8983/solr/MyCloud/select?q=%7B!mlt+qf%3Dsearch_text_st+fl%3Dsearch_text_st+minwl%3D4+maxwl%3D18%7D123

The response looks like this:

"response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]}

I have done nothing so far to enable or configure MLTQParser, but it does appear to be enabled because I get an error when using a document ID that doesn't exist.

Any idea why this is not working?

1

1 Answers

1
votes

I eventually figured out why this was failing. The search_text_st field was being created using copyField. The Cloud MLT Query Parser uses the realtime get handler to retrieve the fields to be mined for keywords. Because of the way the realtime get handler is implemented, it does not return data for fields populated using copyField. (see https://issues.apache.org/jira/browse/SOLR-3743)

Changing the configuration to use the source fields made it work.