RavenDb MapReduce覆盖数据子集 [英] RavenDb MapReduce over subset of Data
问题描述
说我在RavenDb中具有给定的文档结构
Say I have the given document structure in RavenDb
public class Car {
public string Manufacturer {get;set;}
public int BuildYear {get;set;}
public string Colour {get;set;}
public string Id {get;set;}
}
当用户搜索所有颜色为Red且制造年份为2010的汽车时,我想向他们显示制造商的分组,例如:
When the user searches for all cars of colour Red and build year 2010, I want to show them a grouping for manufacturer as such:
丰田(12)
马自达(30)
Toyota (12)
Mazda (30)
鉴于有12个丰田汽车和30个马自达汽车为红色,制造年份为2010.
Given there are 12 toyotas and 30 mazdas that are red in colour and build year 2010.
这是一个简化的用例.用户可以真正为他们想要匹配的汽车指定大量标准.一旦有了符合该条件的汽车列表,就需要对每个功能上的结果集进行分组并显示计数. 就像MapReduce一样,但是只包含一部分数据.
This is a simplified use case. The user can really specify tons of criteria for the cars they want to match. Once I have a list of cars matching that criteria then I need to group that result set on every feature and show a count. Its like a MapReduce but on a subset of data.
推荐答案
Afif,您的意思是称为多面搜索.多亏了底层的Lucene.NET组件,RavenDB才能做到这一点.在这里看看: http://ravendb.net/documentation/faceted-search
Afif, what you mean is called a faceted search. Thanks to the underlying Lucene.NET component RavenDB is very good at that. Take a look here: http://ravendb.net/documentation/faceted-search
这篇关于RavenDb MapReduce覆盖数据子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!