rfferrao
(Ramiro Fróes Ferrão)
October 26, 2020, 2:34pm
1
Is it possible to do this? Here's what I've tried:
{
"query": {
"bool": {
"should": {
"has_child": {
"type": "group",
"query": { "bool": { "should": { "match_all": { } } } },
"inner_hits": { },
"min_children": 0
}
}
}
}
}
Yet, even with "min_children": 0
the only hits are the parent documents containing 1 or more children.
rfferrao
(Ramiro Fróes Ferrão)
October 26, 2020, 3:36pm
2
Just found a solution, here's a way to do it:
{
"query": {
"bool": {
"filter": {
"term": {
"my_join_field": "user"
}
},
"should": [
{
"bool": {
"must_not": [
{
"has_child": {
"type": "group",
"query": {
"match_all": {}
}
}
}
]
}
},
{
"has_child": {
"inner_hits": {},
"type": "group",
"query": {
"match_all": {}
}
}
}
]
}
}
}
system
(system)
Closed
November 23, 2020, 3:37pm
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.