# Last seen time for term values?

**URL:** <https://discuss.elastic.co/t/last-seen-time-for-term-values/15523>\
**Category:** Elasticsearch\
**Created:** [January 31, 2014, 8:03am UTC](https://discuss.elastic.co/t/last-seen-time-for-term-values/15523 "2014-01-31T08:03:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Stanford](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_stanford/32/1647_2.png) [@John\_Stanford](https://discuss.elastic.co/u/John_Stanford)\
**Post date:** [January 31, 2014, 8:03am UTC](https://discuss.elastic.co/t/last-seen-time-for-term-values/15523/1 "2014-01-31T08:03:55Z")

</div>

Hi,

I have a mapping that has a host and a timestamp (among other fields), and  
would like to get a "last seen time" for some number of recently seen  
hosts. Is there a better way to do this than to first do a term facet on  
the host field, then a range query (limit=1) on each of the term values  
sorted in descending order?

Thanks,  
John

--  
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/496aea33-2314-4a47-9cbd-e1f2a4f76138%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/496aea33-2314-4a47-9cbd-e1f2a4f76138%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:53am UTC](https://discuss.elastic.co/t/last-seen-time-for-term-values/15523/2 "2017-07-06T01:53:45Z")

</div>

Closed on July 6, 2017, 1:53am UTC


