# ElasticSearch Queries with spring Framework

**URL:** <https://discuss.elastic.co/t/elasticsearch-queries-with-spring-framework/93754>\
**Category:** Elasticsearch\
**Created:** [July 19, 2017, 11:41am UTC](https://discuss.elastic.co/t/elasticsearch-queries-with-spring-framework/93754 "2017-07-19T11:41:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Abraham](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Abraham](https://discuss.elastic.co/u/Joe_Abraham)\
**Post date:** [July 19, 2017, 11:41am UTC](https://discuss.elastic.co/t/elasticsearch-queries-with-spring-framework/93754/1 "2017-07-19T11:41:18Z")

</div>

I`m trying to get data from ES using the @Query annotation.  
I used the following query and got the required result but the number of records fetched is 10

@Query("{"bool":{"must":[{"term":{"attendanceDate": "?0"}}]}} ")

But i need more records to be fetched, and used the size constraint to specify the size using the following query, unfortunately it don't work.

@Query( "{"bool":{"must":[{"term":{"attendanceDate": "?0"}}]}},"from": 0,"size": 50 ")

I'm using ES 2.4.5 and spring framework

---

<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:** [August 16, 2017, 11:42am UTC](https://discuss.elastic.co/t/elasticsearch-queries-with-spring-framework/93754/2 "2017-08-16T11:42:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
