Jacobian
Jacobian

Reputation: 10802

How to get a list of all document types

I use elesticserach_dsl in Python to do searching, and I really like it. But the thing I do not know how to impement, is how to get a list of all different document types. The catch is type field plays for me almost the same role as table name in SQL, and what I want to do, is to somehow mimic SHOW TABLES command.

Upvotes: 0

Views: 69

Answers (1)

Andrei Stefan
Andrei Stefan

Reputation: 52368

I don't know how to do this in Python, but from Elasticsearch point of view, this is how the request looks like:

GET /_all/_search?search_type=count
{
  "aggs": {
    "NAME": {
      "terms": {
        "field": "_type",
        "size": 100
      }
    }
  }
}

Upvotes: 1

Related Questions