# Elasticsearch Jasvascript API Query size problems

**URL:** <https://discuss.elastic.co/t/elasticsearch-jasvascript-api-query-size-problems/86592>\
**Category:** Elasticsearch\
**Created:** [May 22, 2017, 2:09am UTC](https://discuss.elastic.co/t/elasticsearch-jasvascript-api-query-size-problems/86592 "2017-05-22T02:09:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dreadlocked](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dreadlocked](https://discuss.elastic.co/u/Dreadlocked)\
**Post date:** [May 22, 2017, 2:09am UTC](https://discuss.elastic.co/t/elasticsearch-jasvascript-api-query-size-problems/86592/1 "2017-05-22T02:09:50Z")

</div>

Hello, I'm doing the following query to elasticsearch using the JS API:

```
client.search({
  index: 'winlogbeat-2017.05.19',
  size : 50,
  body : {
    query : { 
    	match : { tags : "example-tag" } 
    }
  }
}).then(function (body) {
  ...
 }

```

There are only 26 registers with the tag "example-tag", but Elasticsearch returns 50 results, the first 26th are with the "example-tag" tag, and the rest are results of the same index, in the correct timestamp order but without the "example-tag" tag.

How can I only retrieve results with the "example-tag" tag?

---

<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:** [June 19, 2017, 2:10am UTC](https://discuss.elastic.co/t/elasticsearch-jasvascript-api-query-size-problems/86592/2 "2017-06-19T02:10:13Z")

</div>

Closed on June 19, 2017, 2:10am UTC

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