Solr MoreLikeThis: Can I give Solr 5 document IDs and get more documents like these 5?

StackOverflow https://stackoverflow.com/questions/14029457

  •  12-12-2021
  •  | 
  •  

Question

I'm unclear on this point from the documentation. Is it possible to give Solr X document IDs and tell it that I want documents similar to those?

Example:

  • The user is browsing 5 different articles
  • I send Solr the IDs of these 5 articles so I can present the user other similar articles

I am not clear about sending the document IDs, nor whether MoreLikeThis can operate on multiple documents as in this example.

Était-ce utile?

La solution

you can try passing multiple Ids with the Query q=id:(document_id1 OR document_id2 OR document_id3) :-

e.g.

http://localhost:8080/solr/select/?qt=mlt&q=id:(document_id1 OR document_id2 OR document_id3)&mlt.fl=[field1],[field2],[field3]&fl=id&rows=10
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top