How to get subtype's statistical data of nested object with dynamic query?

Hello,
In my project, we use nested object with different keys, for example,
the following messages are indexed
message1: {type: type1, nestedObj: {key1:value1, key2:
value2}}
message2: {type: type2, nestedObj: {key1:value3, key2:
value4, key3:value5}}
Maybe there are many different keys. Now we want to calculate how many
different key are used for each type. Eg. type1 contains key1 and key2.
type2 contains key1, key2 and key3.
How can I get this data? Although I can get the _mapping, but it
contains all of the keys used in nestedObject for all types. And I also
tried facet, it seems that my above requirement can't be met.

Thank you very much in advance.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Is there any work around to solve this problem?
Appreciating your help!

在 2013年8月1日星期四UTC+8上午11时39分20秒,Leoncin写道:

Hello,
In my project, we use nested object with different keys, for example,
the following messages are indexed
message1: {type: type1, nestedObj: {key1:value1, key2:
value2}}
message2: {type: type2, nestedObj: {key1:value3, key2:
value4, key3:value5}}
Maybe there are many different keys. Now we want to calculate how many
different key are used for each type. Eg. type1 contains key1 and key2.
type2 contains key1, key2 and key3.
How can I get this data? Although I can get the _mapping, but it
contains all of the keys used in nestedObject for all types. And I also
tried facet, it seems that my above requirement can't be met.

Thank you very much in advance.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.