Hello everyone.
We want to Implement a statistical analysis requirement. There are two ways to meet my requirement after viewing the Solr Ref Guide(8.11) Schema is defined as follows: timestamp, indexd=true, docValues=true status, indexed=true, docValues=true user_count, indexed=true, docValues=true way, indexed=true, docValues=true 1. use json.facet q=timestamp:[1651334400000 TO 1654012800000]&json.facet={agg:{status:terms,field:way,+facet:{paid_amount:"sum(if(eq(status,+30),user_count,0))",paid_count:"sum(if(eq(status,+30),1,0))",deposit_amount:"sum(if(eq(status,+13), user_count,0))",deposit_count:"sum(if(eq(status,+13),1,0))",refunded_amount:"sum(if(eq(status,+11), user_count,0))",refunded_count:"sum(if(eq(status,+11),1,0))",deposit_canceled_amount:"sum(if(eq(status,+14),user_count,0))",deposit_canceled_count:"sum(if(eq(status,+14),1,0))",canceled_amount:"sum(if(eq(status,+10),user_count,0))",canceled_count:"sum(if(eq(status,+10),1,0))",charge_amount:"sum(if(eq(status,+15),original_amount,0))",charge_count:"sum(if(eq(status,+15),1,0))",charge_refund_amount:"sum(if(eq(status,+21),user_count,0))",charge_refund_count:"sum(if(eq(status,+21),1,0))",order_take_amount:"sum(if(eq(status,+16),original_amount,0))",order_take_count:"sum(if(eq(status,+16),1,0))",order_take_refund_amount:"sum(if(eq(status,+22),user_count,0))",order_take_refund_count:"sum(if(eq(type,+22),1,0))",store_pay_amount:"sum(if(eq(type,+17),user_count,0))",store_pay_count:"sum(if(eq(status,+17),1,0))",store_refund_amount:"sum(if(eq(status,+20),user_count,0))",store_refund_count:"sum(if(eq(status,+20),1,0))",store_in_amount:"sum(if(eq(status,+18),user_count,0))",store_in_count:"sum(if(eq(type,+18),1,0))",store_in_refund_amount:"sum(if(eq(type,+19),user_count,0))",store_in_refund_count:"sum(if(eq(status,+19),1,0))"}}}&rows=0 2. use stats q=timestamp:[1651334400000 TO 1654012800000]&stats=true&stats.facet=status&stats.field={!sum=true count=true}user_count&rows=0 I wonder if there is any performance difference between the two. Thanks.