Hi,

Terms aggregations do not support wildcards, they can only run on a single
field. In order to do this, you would need to concatenate all your field
values in a single field at indexing time.

On Mon, Dec 15, 2014 at 7:26 AM, 唐坤 <[email protected]> wrote:
>
> I have a scene.
>
> -------------------------
> Data A
> {
>     name:"foodA",
>     props:{
>       color: "red",
>       taste: "sweet",
>       xx: xx,
>       xx: xx
>     }
> }
>
> Date B
> {
>     name:"foodB",
>     props:{
>       color: "black",
>       taste: "sweet",
>       xx: xx,
>       xx: xx
>     }
> }
>
>
>
> the props field is dynamic, is custom.
>
>
> -----------------------------
>
> i want result data is
>
> {
>     "aggregation": {
>          color: [
>             {key:"red", count: 1},
>             {key:"black", count: 1}
>          ],
>          xx: [
>             {key:"xx", count: xx},
>          ]
>      }
> }
>
> ----------------------------
>
> i use the dsl
> {
>   "aggs": {
>     "all": {
>       "terms": {
>         "field": "props.*"
>       }
>     }
>   }
> }
>
>
> but return nothing.  i don't konw how to do
>
>  --
> 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/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adrien Grand

-- 
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/CAL6Z4j6GZmyYttCRLkKROtpde-u2G8XysT771sE4SBgbPKtCBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to