elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

Nested field support #1084

Open Alex-Ikanow opened 10 years ago

Alex-Ikanow commented 10 years ago

This is sort of a duplicate of some other issues I searched for but I haven't seen this particular aspect discussed, so I thought this was worth a separate issue.

You read the _mapping field, so you should know when a particular field is nested, so can it not automatically apply the correct nested facet/query when such a field is selected in queries or facets?

(Alternatively/in addition as suggested by #532, you could have a checkbox to allow users to select it themselves, perhaps as an interim measure)

I'm sure there are some cases where this gets complicated, but there are also a bunch of cases where it's a straightforward changing of one block of JSON to another.

Latest update: https://github.com/elastic/kibana/issues/1084#issuecomment-585178079

shayts7 commented 9 years ago

+1 for nested object aggregation.

matthewgaulin commented 9 years ago

+1

Charlesbot commented 9 years ago

+1

ghost commented 9 years ago

+1

bzz commented 9 years ago

+1

Kallin commented 9 years ago

+1

deepakas commented 9 years ago

+1

matogertel commented 9 years ago

+1

c0deaddict commented 9 years ago

+1

theNewFlesh commented 9 years ago

+1

krisb78 commented 9 years ago

+100000

ddaumann commented 9 years ago

+1

Kallin commented 9 years ago

to be clear, there is no way to do a nested filter/query/agg in kibana 4 right now, is there?

Medi0ker commented 9 years ago

+1

ajrasch commented 9 years ago

+11111

calippo commented 9 years ago

+1

polloelastico commented 9 years ago

+1

Filirom1 commented 9 years ago

+1

MichaelBorde commented 9 years ago

+1

vordimous commented 9 years ago

+1

tonymwinters commented 9 years ago

+1

KevinFarrell commented 9 years ago

+1

nbeede commented 9 years ago

+2

calvdee commented 9 years ago

+1

beiske commented 9 years ago

+1 Because denormalizing nested objects is not always an option as this may lead to a mapping explosion.

Mapping:

{ 
 "timestamp":{ "type":"date"},
 "cluster_id": { "type":"string"},
 "pools":{
    "type":"nested",
    "properties":{
      "size":{
        "type":"long"
      },
      "name":{
        "type":"string",
        "index":"not_analyzed"
      }
    }
  }
}

First of all I would like to the line chart to be able to show the average size over time for each pool name. Assuming that there are that many names so that denormalizing is not a good idea, this might lead to many graphs in the chart. In order to work with such cases it would also be beneficial to be able to use the filter agregation inside a nested aggregation. Being able to filter on nested fields in the top search would also be great.

To make things even more interresting it would be really great to be able to visualize an aggregation like this:

"aggs": {
        "poolagg": {
            "nested": {
                "path": "pools"
            },
            "aggs": {
                "old": {
                    "filter": {
                        "term": {
                            "name": "some pool name"
                        }
                    },
                    "aggs": {
                        "avg_size": {
                            "avg": {
                                "field": "size"
                            }
                        },
                        "distribution": {
                            "histogram": {
                                "field": "size",
                                "interval": 5
                            },
                            "aggs": {
                                "pool_to_cluster": {
                                    "reverse_nested": {},
                                    "aggs": {
                                        "clusters": {
                                            "cardinality": {
                                                "field": "cluster_id"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
AjmalVh commented 9 years ago

+1

rvhaasen commented 9 years ago

+2

ryanrozich commented 9 years ago

+1

jonusko commented 9 years ago

+1

tweemeterjop commented 9 years ago

+1

wenxiang commented 9 years ago

+1

kaliseo commented 9 years ago

+10 !

It would be powerfull with this !

cslinuxboy commented 9 years ago

So can someone clarify this; In this post (https://www.elastic.co/blog/kibana-4-beta-1-released) for Kibana4beta1 it states that "Kibana 4 brings the power of Elasticsearch's nested aggregations to the click of a mouse. " However I'm unable to create any visualizations on documents with nested objects. I've also made sure the nested objects in my index template are marked as "nested". So is Kibana's support for nested aggregations not the same as ES's support for nested objects? What am I missing? Thanks.

Alex-Ikanow commented 9 years ago

@cslinuxboy - I think they're using "nested" here to refer to grouping via multiple fields, eg "aggregate by time then geo" (not "nested" as in its use in the platform for "nested objects")

cslinuxboy commented 9 years ago

@Alex-Ikanow - Thanks for the reply. Too bad this is not possible at this time. I got my hopes up when reading the misleading description on their beta-1 post.

+1 for support of nested objects within visualization aggregation.

mateialexandru commented 9 years ago

+1

calvdee commented 9 years ago

I'm currently using parent/child relationships as a workaround which seems to be working fine.

ajrasch commented 9 years ago

@calvdee Have you got has_parent or has_child queries to work in the Kibana search bar? This isn't working for us and it's a huge problem, I would be ETERNALLY grateful if you have this working and can let me know...thanks!!!

calvdee commented 9 years ago

No, for our use case all parents have children and all children necessarily have parents since we are indexing invoice data so regular queries just work (see image).

image

ajrasch commented 9 years ago

@calvdee Thanks so much for the reply! We have a similar data model but want to be able to find parents by their children in Kibana, it's not working :0(

calvdee commented 9 years ago

No worries, good luck!

On Thu, Mar 26, 2015, 11:36 ajrasch notifications@github.com wrote:

@calvdee https://github.com/calvdee Thanks so much for the reply! We have a similar data model but want to be able to find parents by their children in Kibana, it's not working :0(

— Reply to this email directly or view it on GitHub https://github.com/elastic/kibana/issues/1084#issuecomment-86575796.

fmeiser commented 9 years ago

+1

arnisoph commented 9 years ago

+1

quasipedia commented 9 years ago

You read the _mapping field, so you should know when a particular field is nested, so can it not automatically apply the correct nested facet/query when such a field is selected in queries or facets?

Yes, :+1: on this one. Although I managed to write the correct nested aggregation on CLI, and can pull data with curl, I haven't found a way to get it working in Kibana's "Visualise" tab, not even using the JSON edit box. Admittedly, I never use that feature (the box), but it seems that it is possible only to "add" stuff to an existing aggregation, not to use it for creating a new aggregation from scratch... (will appreciate to be corrected if I am wrong on this!).

bradvido commented 9 years ago

Yes, nested type aggregations are key and becoming more widely used because they solve a specific problem with flat data.

If Kibana4 is the visualization product for ES, it should support all ES aggregations.

It would be nice to at least see this on the roadmap for Kibana4.

benjismith commented 9 years ago

+1

immunochomik commented 9 years ago

+1

u238 commented 9 years ago

+1

nicholaskuechler commented 9 years ago

+1

krriyo commented 9 years ago

+1