简体   繁体   English

返回在多值字段中具有最大交集的Solr文档

[英]Return Solr documents with maximum intersection in a multivalued field

Consider the following solr document. 考虑以下solr文档。

 {
     "id":"71850",
     "title":"Blah Blah Blah",
     "tags":["Lifestyle","Relationship","Social Wellness"],
     "_version_":1557041802828054529
  }

The document represents a blog post and a few tags associated with it. 该文档代表一个博客文章以及与之相关的一些标签。 The problem I am trying to solve is to get the most relevant documents to a given blog post based on maximum tags intersection. 我要解决的问题是根据最大tags交集将最相关的文档发送到给定的博客文章中。

Here tags is a multivalued field. tags在这里是一个多值字段。

The documents having more intersection should be ordered higher in the result.For example the documents with 3 tag matches should appear higher than the ones which have 2 tag matches and so on. 具有更大交集的文档应在结果中排​​序更高,例如,具有3 tag匹配项的文档应显示得比具有2 tag匹配项的文档更高,依此类推。

Any suggestion would be helpful. 任何建议都会有所帮助。

can you try the following query: 您可以尝试以下查询:

http://localhost:8983/solr/core1/select?q= "Lifestyle" "Relationship" "Social Wellness"&qf=tags http:// localhost:8983 / solr / core1 / select?q = “生活方式”“关系”“社交健康”&qf = tags

Maybe this fits your needs. 也许这符合您的需求。

Best regards, ewatch 此致ewatch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM