Listing all values of one field


#1

Hello,

I have a big index (in fact many: one per day) with a field "id". I would like to know each value that this field has. The classical answer is :

{
  "size": 0,
  "aggs": {
    "2": {
      "terms": {
        "field": "id.keyword",
        "size": 100
      }
    }
  }
}

This is working! However it doesn't help me because:

  • I need all the values, not the top 100
  • I have a cardinality of millions and the 12 big server ES is hanging with size = 100000

However:

  • I don't need to order the fields
  • I don't need the counts

Is there a way to just get the list of the values of "id.keyword"?

/EDIT/ I'm using a 6.0.0 version of ES.


#2

I forgot to mention, I'm using ES 6.0.0.


(Alexander Reelsen) #3

You could take a look at the composite aggregation, allowing you to paginate through all buckets.


#4

Unfortunately, the composite aggregation is not available for 6.0.0 Elasticsearch.


(Christian Dahlqvist) #5

Sounds like a potentially good reason to upgrade to a more recent release.


(system) closed #6

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