aquasecurity / aquasecurity/esquery

How to use nested query filter?

Open
#29 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
317
Forks
58
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

The issue provides only an Elasticsearch JSON example and names no repository file, test, or entry point. Start by locating the builder API for nested queries and checking whether it can express the outer date range and child must_not term together. Done is a documented or demonstrated query shape that filters the parent and child as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, go
Domain
backend-api-design
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.