0
votes

I have below data format.

ID####Title####IMGURL####DESC####notable_for####page-rank

1--##########--Sachin Tendulkar--##########--https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Sachin.Tendulkar.jpg--##########--Sachin Tendulkar is a former Indian cricketer and captain, widely regarded as one of the greatest batsmen of all time.--##########--Cricket, Batsman, Indian
2--##########--Virendra sehwag--##########--https://en.wikipedia.org/wiki/File:Virendra_sehwag_72.jpg--##########--Virendra sehwag is a former Indian cricketer. An aggressive right-handed opening batsman and a part-time right-arm off-spin bowler.--##########--Cricket, Batsman, Indian
3--##########--Anil Kumble--##########--https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Anil_Kumble.jpg--##########--Anil Kumble is a former international cricketer and former captain of the Indian cricket team..--##########--Cricket, Bowler, Indian

I have indexed above data and if I query below

http://107.22.244.98:8983/solr/wiki_core/select?q=sachin&wt=json&indent=true&sort=rank%20desc

I get below response.

 {
        "id":"1",
        "rank":300,
        "title":"Sachin Tendulkar",
        "desc":"Sachin Tendulkar is a former Indian cricketer and captain, widely regarded as one of the greatest batsmen of all time.",
        "image":"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Sachin.Tendulkar.jpg",
        "attributes":["Cricket",
          " Batsman",
          " Indian"],
        "_version_":1525953516716163072
}

Along with this I need related documents based on attributes. Mean I need all those documents where attributes are like Cricket OR Batsman OR Indian or combination of any of these.

I have checked solr for this specific need but found "MoreLikeThisHandler" does the same thing.

I can understand that by creating separate handler I can achieve this. But i want to retrieve all the documents which are similar to first result in single query. Is it possible?

1
Can you post your select handler from your solrconfig.xml file?Periklis Douvitsas

1 Answers

0
votes

MLT is available through the regular SearchHandler by setting mlt=on in your URL. All the regular MLT arguments are available through mlt.<setting>. This is what's named the MoreLikeThisComponent (while the MoreLikeThisHandler is the one exposed as a separate requestHandler).

The difference is what's considered the main set of documents to be filtered. The component version retrieves morelikethis for each document in the set (where the main query result documents are filtered by fq, etc.), while the handler version returns the MLT documents as the main list of documents, which is then filtered.