Solr Group Truncate vs Collapse
Few months ago, I was working with an eCommerce company. Its products had different sellers with different prices of each seller. We called product data with seller data and price together as an offer. In document structure, we maintained document for offer and duplicated products data into offer document. For example There are 2 offers for product p1 o11 having selling price Rs. 10 o12 having selling price Rs. 9 There are 2 offers for product p2 o21 having selling price Rs. 8 o22 having selling price Rs. 12 Below are 4 offer documents. { offerId: o11, productId: p1, price: 10 } { offerId: o12, productId: p1, price: 9 } { offerId: o21, productId: p2, price: 8 } { offerId: o22, productId: p2, price: 12 } Solr did not had facility to Store offers as a child documents of a product document that time. We had to duplicate the product data into offer data. To query product we grouped the offers with the productId, sorted by price asc and truncated into one ...