问题
I have 5 node cluster in SolrCloud, with 2 shards per node,
Solr version:6.3.0
now when I run mlt query it only returns result per node and doesn't distribute them over all shards/nodes, i.e
http://10.0.1.15:8983/solr/test_ingest/mlt?q=advertising_id%w72w9424620427042&fl=score&fl=advertising_id&mlt.fl=channel_name&mlt.fl=show_name&mlt.fl=language&mlt.mindf=1
gives no results while
http://10.0.1.119:8983/solr/test_ingest/mlt?q=advertising_id%w72w9424620427042&fl=score&fl=advertising_id&mlt.fl=channel_name&mlt.fl=show_name&mlt.fl=language&mlt.mindf=1
gives results,
I have even tried specifying this as param:
shards=10.0.1.84:8983/solr/test_ingest_shard3_replica1,10.0.1.84:8983/solr/test_ingest_shard8_replica1,10.0.1.206:8983/solr/test_ingest_shard2_replica1,10.0.1.206:8983/solr/test_ingest_shard7_replica1,10.0.1.15:8983/solr/test_ingest_shard5_replica1,10.0.1.15:8983/solr/test_ingest_shard10_replica1,10.0.1.207:8983/solr/test_ingest_shard1_replica1,10.0.1.207:8983/solr/test_ingest_shard6_replica1,10.0.1.119:8983/solr/test_ingest_shard9_replica1,10.0.1.119:8983/solr/test_ingest_shard4_replica1
My request handler:
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
</requestHandler>
How do I configure mlt to run a distributed search? Thanks
回答1:
The More Like This Handler is, as far as I know, single shard only, so it'll only consider the documents available in the local shard.
The More Like This Query Parser do however mention that it is Solr Cloud-aware, so try using that instead.
MLTQParser enables retrieving documents that are similar to a given document. It uses Lucene's existing MoreLikeThis logic and also works in SolrCloud mode. The document identifier used here is the unique id value and not the Lucene internal document id. The list of returned documents excludes the queried document.
Find documents like the document with id=1 and using the name field for similarity.
{!mlt qf=name}1
Adding more constraints to what qualifies as similar using mintf and mindf.
{!mlt qf=name mintf=2 mindf=3}1
来源:https://stackoverflow.com/questions/43390064/solr-morelikethis-not-working-for-multiple-shards