# Took is having a different value than the time ES is taking to show the result in Kibana

**URL:** <https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182>\
**Category:** Elasticsearch\
**Created:** [March 6, 2019, 6:44pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182 "2019-03-06T18:44:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subir\_Adhikari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subir_adhikari/32/41638_2.png) [@Subir\_Adhikari](https://discuss.elastic.co/u/Subir_Adhikari)\
**Post date:** [March 6, 2019, 6:44pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/1 "2019-03-06T18:44:46Z")

</div>

I have a query in Elastic Search which is fetching 10000 records having approximately 8MB of data. In the "took" tag in the JSON response, it is showing "1071" . However the response is actually appearing in Kibana after approximately, 6 to 7 seconds later. Same thing is observed, when I am executing it from JAVA API. After doing some googling, I understood that "took" includes only the query execution time in Elastic Search and hence does not include the time for the following:

1. Sending the response to the server

2. Deserializing the request from JSON on the server

3. Serializing the response into JSON on the server

4. Sending the response over the network

So, given the above scenario, what measures can I take to make sure that it appears in a very reasonable time (in 2 to 3 seconds)?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 7, 2019, 4:50pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/2 "2019-03-07T16:50:01Z")

</div>

What does your query look like?  
Why do you need to get 10000 documents back?

---

<div class="post-metadata">

**Author:** ![Subir\_Adhikari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subir_adhikari/32/41638_2.png) [@Subir\_Adhikari](https://discuss.elastic.co/u/Subir_Adhikari)\
**Post date:** [March 7, 2019, 6:47pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/3 "2019-03-07T18:47:48Z")

</div>

Actually, another application is dependent on this query and at a certain given time, we do not expect the result to be more than 10000 but it can very easily be e.g. 8000. So we have kept the upper limit as 10000.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 7, 2019, 7:00pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/4 "2019-03-07T19:00:44Z")

</div>

Does it mean that you are giving 10000 results back to your users?

---

<div class="post-metadata">

**Author:** ![Subir\_Adhikari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subir_adhikari/32/41638_2.png) [@Subir\_Adhikari](https://discuss.elastic.co/u/Subir_Adhikari)\
**Post date:** [March 7, 2019, 7:55pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/5 "2019-03-07T19:55:33Z")

</div>

Well, we are giving this data to another application which has some other business logic for further clean up and after that the data is being presented to the user.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 7, 2019, 8:21pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/6 "2019-03-07T20:21:47Z")

</div>

You should better use the scroll API with a more reasonable size depending on your tests.  
You can extract millions of rows if you wish with that.

---

<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:** [April 4, 2019, 8:33pm UTC](https://discuss.elastic.co/t/took-is-having-a-different-value-than-the-time-es-is-taking-to-show-the-result-in-kibana/171182/7 "2019-04-04T20:33:44Z")

</div>

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