RavenDb MapReduce over subset of Data

我的梦境 提交于 2019-12-12 13:05:34

问题


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;}
}

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:

Toyota (12)
Mazda (30)

Given there are 12 toyotas and 30 mazdas that are red in colour and build year 2010.

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.


回答1:


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



来源:https://stackoverflow.com/questions/7843739/ravendb-mapreduce-over-subset-of-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!