Great question. I do not think there is an API to get that data (someone
please correct me if I am wrong), but since the type is basically just
another field inside the Lucene document, you can also run a
aggregation/facet on the implicit field called _type:

{
    "size": 0,
    "query": {"match_all": {}},
    "aggs" : {
        "types" : {
            "terms" : { "field" : "_type" }
        }
    }
}

Cheers,

Ivan


On Sun, Jun 29, 2014 at 9:40 AM, Jinyuan Zhou <[email protected]>
wrote:

> Thanks,
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBvxuxkia1wXGpZNNME4_yycZjBX_Enae1u-3yEfV3MTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to