I have a statement: ES_dsl.Q('nested', path='student', query=nest_filter)
What kind of role does the "path" play in the above one?
The path
is simply the path to the nested field you're using in your query.
In nest_filter
, you need to reference your nested field as student.xyz
.
Check the equivalence in the query below:
GET /_search
{
"query": {
"nested" : {
"path" : "student", <--- this is the path
"query" : { <--- this is nest_filter
"bool" : {
{ "match" : {"student.name" : "john"} },
{ "range" : {"student.age" : {"gt" : 20}} }
]
}
}
}
}
}