# Can you get the number of hits and the time taken for a query with hive?

**URL:** <https://discuss.elastic.co/t/can-you-get-the-number-of-hits-and-the-time-taken-for-a-query-with-hive/54671>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [July 4, 2016, 5:52pm UTC](https://discuss.elastic.co/t/can-you-get-the-number-of-hits-and-the-time-taken-for-a-query-with-hive/54671 "2016-07-04T17:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v170](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@v170](https://discuss.elastic.co/u/v170)\
**Post date:** [July 4, 2016, 5:52pm UTC](https://discuss.elastic.co/t/can-you-get-the-number-of-hits-and-the-time-taken-for-a-query-with-hive/54671/1 "2016-07-04T17:52:17Z")

</div>

I've been looking around for this and other than doing a select count there doesn't seem to be a quick way to get the number of hits when creating a table with a query from hive. Maybe I miss something because when I do a show tblproperties on a table created with the elasticsearch handler it doesn't show the row count.

Also, is there a way to order the results by relevance when creating the hive table with a query?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [March 31, 2017, 6:28pm UTC](https://discuss.elastic.co/t/can-you-get-the-number-of-hits-and-the-time-taken-for-a-query-with-hive/54671/2 "2017-03-31T18:28:51Z")

</div>

You have to compute the statistics.

analyze table TABLE\_NAME compute statistics;

---

<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:22pm UTC](https://discuss.elastic.co/t/can-you-get-the-number-of-hits-and-the-time-taken-for-a-query-with-hive/54671/3 "2017-07-06T13:22:16Z")

</div>


