# Group property into elasticsearch

**URL:** <https://discuss.elastic.co/t/group-property-into-elasticsearch/17451>\
**Category:** Elasticsearch\
**Created:** [May 12, 2014, 4:57am UTC](https://discuss.elastic.co/t/group-property-into-elasticsearch/17451 "2014-05-12T04:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ha\_Lan\_Quyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ha_lan_quyen/32/1585_2.png) [@Ha\_Lan\_Quyen](https://discuss.elastic.co/u/Ha_Lan_Quyen)\
**Post date:** [May 12, 2014, 4:57am UTC](https://discuss.elastic.co/t/group-property-into-elasticsearch/17451/1 "2014-05-12T04:57:53Z")

</div>

Hi everyone,

I have a query in SQL like this:  
Criteria crit = session.createCriteria(SignupLog.class);  
if (start != null) {  
crit.add(Restrictions.ge("reqDate", start));  
}  
if (finish != null) {  
crit.add(Restrictions.le("reqDate", finish));  
}  
if (website != null) {  
crit.add(Restrictions.eq("website", website));  
}  
if (org != null) {  
crit.add(Restrictions.eq("organisation", org));  
}  
crit.setProjection(Projections.projectionList()  
.add(Projections.min("reqDate"))  
.add(Projections.rowCount())  
.add(Projections.groupProperty("groupEntity"))  
.add(Projections.groupProperty("reqYear"))  
.add(Projections.groupProperty("reqMonth"))  
.add(Projections.groupProperty("reqDay")));

And for now I want to do it by using elasticsearch? How can I do it?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/66e48265-1ae1-4bf0-b7cb-962ec6efd9a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/66e48265-1ae1-4bf0-b7cb-962ec6efd9a9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:30am UTC](https://discuss.elastic.co/t/group-property-into-elasticsearch/17451/2 "2017-07-06T01:30:15Z")

</div>


