1

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 stock(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

2
  • Could you write how many rows of data you have? Could also add which db you tried?
    – Skarab
    Apr 21, 2011 at 12:21
  • Postgresql. Indexing data comparable with tens millions
    – Tioma
    Apr 22, 2011 at 8:07

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.