Object recursion with ES and Kibana

Hi All!

In my application I'm using an activity tree to represent what someone can do.
It's looking like this:


Whenever someone register their timespend I store the id of the activity they chose.
After that in Kibana I'd like to make reports on time spends recursively. EG. I want to know every registered timespend which is in the activity of Internal or below internal or below that, etc...

How to create this kind of mapping?
Right now it's looking like this:

{
        'properties': {
            'owner': {
                'type': 'object',
                'properties': {
                    'username': {'type': 'keyword'},
                }
            },
            'activity': {
                'type': 'object',
                'properties': {
                    'name': {'type': 'keyword'},
                    'parent': {?????}
                }
            },
            'project': {
                'type': 'object',
                'properties': {
                    'name': {'type': 'keyword'},
                }
            },
            'description': {'type': 'text'},
            'worked_hours': {'type': 'short'},
            'from_date': {'type': 'date'},
            'to_date': {'type': 'date'},
        }
    }

Thanks in advance,
Álmos

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.