I want to write a query which will apply a date filter while summing the value in the numberofcomments field. So find users who have commented more than 10 times between 2017-09-23 and 2017-10-01.
How should I modify the query that you provided, to return something like all users who live in "LONDON" and are between 25 to 35 years old and have commented more than 10 times in total between 2017-09-23 and 2017-10-01?
In the comments_by_day field there are 2 nested documents which are between 2017-09-23 and 2017-10-01 and the sum of the numberofcomments field in those 2 nested documents is 5 + 9 = 14, so this document should be returned by the query.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.