"last seen time" for a term in elasticsearch -


i have mapping has host , timestamp (among other fields), , "last seen time" number of seen hosts. there better way first term facet on host field, range query (limit=1) on each of term values sorted in descending order?

a term stats facet bring min/max timestamp each host wouldn't it?

{     "query" : {         "match_all" : {  }     },     "facets" : {         "host_time_stats" : {             "terms_stats" : {                 "key_field" : "host",                 "value_field" : "timestamp"             }         }     } } 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -