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
  •  | 
  •  

Вопрос

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.

Это было полезно?

Решение

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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top