Skip to content

How to use nested query filter? #29

@akhmadnurmuhammad

Description

@akhmadnurmuhammad

Hi all,

how to make nested query filtering parent based on nested child object, also filter the child to,
something query like this?

{
    "query": {
        "bool": {
            "must": [
                {
                    "range": {
                        "date": {
                            "lt": "2018-07-05T10:00:00.000Z"
                        }
                    }               
                },
                {
                    "nested": {
                        "path": "child",
                        "query": {
                            "bool": {
                                "must_not": {
                                    "term": {
                                        "child.foo": 0
                                    }       
                                }
                            }
                        }
                    }
                }
            ]
        }
    }
}

thank in advice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions