开发者

Lucene/Solr aggregation

I faced with large problem. Lucene can not aggregate data. What alternative solution available.

After some improvement I have and need next :

lucene data example

product_id   distri_id   stock 
1            d1          10
1            d2          20
1            d3          23

I need do query with next condition for example: prod_id =1 and distri_id = (d1 or d2) and stoc开发者_StackOverflow社区k(sum of d1 and d1) > 13.

So I must aggregate data per dsitri and select where sum of stock more the some value. In other SQL terminology I must do GROUP BY distri HAVING sum(stock)>13.

Can somebody suggest what to do in this case.

Thanks!

Best regards, Artem


You might want to have a look at field collapsing patch which I guess offers similar functionality.

Also, this says:

<..>introduced Solr’s Result Grouping, also called Field Collapsing, that limits the number of documents shown for each “group”, normally defined as the unique values in a field or function query. <..> You’ll need a recent nightly build of Solr 4.0-dev, or the newly released LucidWorks Enterprise v1.6, our commercial version of Solr.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜