简体   繁体   English

Solr查询多个集合

[英]Solr query multiple collections

I have multiple collections with different fields in the schema, I would like to perform a search across multiple collections and perform default rank for results across all the collections . 我在架构中有多个具有不同字段的集合,我想在多个集合中执行搜索,并对所有集合中的结果执行默认排名。

Example - I have a document with 'mustang' word occurring 3 times in collection A and also 2 times in Collection B , then I would like the results to show both the documents with the document from collection A first and document from collection B as second result. 示例-我有一个文档“ mustang”在集合A中出现了3次,在集合B中也出现了2次,那么我希望结果同时显示带有集合A中的文档和集合B中的第二文档。结果。

Scoring doesn't only take the number of occurrences into factor, so by default it'll also depend on the number of documents containing that term in the collection as well. 评分不仅将出现次数考虑在内,因此默认情况下,评分还取决于集合中包含该术语的文档数量。 If we're talking about a single term, you can sort by the tf function or something like that - for more complex queries, using collection wide term frequencies may be the only option (but may be costly). 如果我们谈论的是单个术语,则可以按tf函数或类似的函数进行排序-对于更复杂的查询,使用集合范围术语频率可能是唯一的选择(但可能会很昂贵)。

To create one common collection that queries both, use the CREATEALIAS command in the Collections API. 要创建一个对两个查询都进行查询的通用集合,请使用 Collections API中的CREATEALIAS命令。 The collections parameter takes a comma separated list of collections that is represented by the alias, allowing you to query both A and B through the alias C. collections参数采用逗号分隔的集合列表(由别名表示),使您可以通过别名C查询A和B。

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

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