简体   繁体   English

solr / lucene /弹性搜索中的文档合并中,排名/分数如何工作?

[英]How ranking/score works in document joining in solr/lucene/elastic search?

I have 4 indexed documents. 我有4个索引文件。 1. Product category, 2. Product, 3. Product details 4. Sellers. 1.产品类别,2.产品,3.产品详细信息4.卖方。 I need to perform keyword search across all the fields of all four document and return top ranked products. 我需要在所有四个文档的所有字段中执行关键字搜索,并返回排名最高的产品。

Example Product category: Electronics, Cloths and etc 示例产品类别:电子产品,布料等

Example Product : TV, Mobile in category Electronics 示例产品:电视,移动类电子产品

Example Product details: 14 in size, black colour for brand samsung TV 示例产品详细信息:14尺寸,品牌三星电视为黑色

Example seller: Dealer 1, Dealer 2. 卖方示例:经销商1,经销商2。

Example search query: "samsung LED TV" 搜索查询示例:“三星LED电视”

Relationships across these documents are maintained with foreign keys. 这些文档之间的关系使用外键维护。 Ex: Product ducument will have category primary key. 例如:产品文档将具有类别主键。

I need a keyword search which should match against all the fields of these 4 documents and return products based on rank. 我需要一个关键字搜索,该关键字搜索应与这4个文档的所有字段匹配,并根据排名返回产品。

I would approach this problem by searching from child, say search seller fields, product details, product and category separately and finally join the results. 我将通过从子级进行搜索来解决此问题,例如分别搜索卖方字段,产品详细信息,产品和类别,最后加入结果。 The problem is ranking. 问题是排名。 Some of the more relevant products for the user keyword goes down in the result. 与user关键字相关的某些产品在搜索结果中有所下降。

Is there any best way to join documents and search on all the fields of joined documents for some keywords so that the result will be more relevant and ordered? 是否有最佳方法来连接文档并在连接文档的所有字段中搜索某些关键字,以使结果更加相关和有序?

The best way to join documents is before you add them to the index. 联接文档的最佳方法是在将它们添加到索引之前。 Lucene is not a relational database. Lucene不是关系数据库。 There are packages and such that provide similar functionality, but you'll generally be better served by providing all the content you wish to search for a document on within the document itself. 有些软件包和此类软件包提供类似的功能,但是通常可以通过在文档本身内提供希望在文档中搜索的所有内容来更好地为您服务。 I believe you want to search products here, so you could create a product Document with fields like: 我相信您想在这里搜索产品,因此可以使用以下字段创建产品文档:

Name:TV
Category:Electronics Entertainment
Seller:Dealer1 Dealer2
Details:14 in size black etc etc etc
text:TV Electronics Entertainment Dealer1 Dealer2 14 in size black etc etc etc

The text field above is added to provide a field to join everything in the document together, to easily search for anything attached to the document, which seems it would be helpful in your case, since you could then just set text as your default field when searching, or run a query like text:(samsung LED TV) . 添加了上面的text字段以提供一个将文档中的所有内容连接在一起的字段,以轻松地搜索文档中附加的任何内容,这似乎对您有帮助,因为您可以将text设置为默认字段。搜索或运行类似text:(samsung LED TV)的查询。

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

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