Hi,
is there any way in SOLR 5.3 to achieve grouping and do mathematical
operations like sum, avg on a certain document property?

Please find below example: 

<doc>
  <str name="property_code">HIKS</str>
  <str name="property_name">Hotel Holiday Inn King's cross</str>
  <date name="day_of_year>2016-08-21T14:05:00Z</date>
  <long name="number_of_adults">4</long>
  <double name="price">40.99</double>
</doc>

<doc>
  <str name="property_code">HIKS</str>
  <str name="property_name">Hotel Holiday Inn King's cross</str>
  <date name="day_of_year>2016-08-22T14:05:00Z</date>
  <long name="number_of_adults">4</long>
  <double name="price">40.99</double>
</doc>

<doc>
  <str name="property_code">HIKS</str>
  <str name="property_name">Hotel Holiday Inn King's cross</str>
  <date name="day_of_year>2016-08-23T14:05:00Z</date>
  <long name="number_of_adults">4</long>
  <double name="price">40.99</double>
</doc>

We would need to group by the property_code (HIKS) and get the sum of all
the prices from the resulting group.


Thanks,
Andrea



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Group-and-sum-in-SOLR-5-3-tp4289556.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to