Closed maggienj closed 7 years ago
This is how the currently generated query looks like. I guess, i will have to remove the word "filter" , since the word "query" is already present in it. (if it weren't present then i would have replaced the word "filter" to "query"..... )
bool-must_not is already in place... so , no changes in it.
{
"aggs": {
"_match": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"query": {"bool": {"must_not": {"field": "g.v"}}}}}
},
"terms": {
"field": "g.a",
"size": 10
}
},
"_missing": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"query": {"bool": {"must_not": {"field": "g.v"}}}}}
},
"filter": {"query": {"bool": {"must_not": {"field": "g.a"}}}}
}
},
"size": 0
}
well, changed the query now., removed the phrase "query" in it. so, it looks like as shown below...
{
"aggs": {
"_match": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"bool": {"must_not": {"field": "g.v"}}}}
},
"terms": {
"field": "g.a",
"size": 10
}
},
"_missing": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"bool": {"must_not": {"field": "g.v"}}}}
},
"filter": {"bool": {"must_not": {"field": "g.a"}}}
}
},
"size": 0
}
if i change "filter" to "query" then the last line removes the filter too.... and this appears to be an agg filter.... so, i guess the last occurrence of filter shouldn't be touched and kept as is....
"filter": {"bool": {"must_not": {"field": "g.a"}}}
only the "_missing" line should be touched.... to replace the word "filter" with "query"... but, when i try to replace the word "filter" to "query" the last line also gets changed...
well, how should this query look like for it to work correctly? should the last occurrence of "filter" be changed to "query" or kept as is?
please make a branch, push your changes, and make a pull request so I may see your code.
This query looks fine:
"_missing": {"filter": {"bool": {"must_not": {"field": "g.v"}}}}
_missing
is a filter aggregation that accepts a bool.must_not
where expression,
it appears the where expression is wrong. maybe it should read
{"bool": {"must_not": {"exists": {"field": "g.v"}}}}
for clarity the whole line should read:
"_missing": {"filter": {"bool": {"must_not": {"exists": {"field": "g.v"}}}}}
yay! that's it! that worked! test passed! pushing code now.
just to add this to the closing notes here... the below query works fine in es5. test passed.
{
"aggs": {
"_match": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"bool": {"must_not": {"exists": {"field": "g.v"}}}}}
},
"terms": {
"field": "g.a",
"size": 10
}
},
"_missing": {
"aggs": {
"_match": {"terms": {
"field": "g.v",
"size": 10
}},
"_missing": {"filter": {"bool": {"must_not": {"exists": {"field": "g.v"}}}}}
},
"filter": {"bool": {"must_not": {"exists": {"field": "g.a"}}}}
}
},
"size": 0
}
found a problem line:
Log.note("frum {{data}}", data=frum)
you can not log frum
its structure is to complicated. Pull from upstream es5 to get a fix that shows you file and line the problem is in
those lines were removed as part of a different branch. but it wasn't merged in this branch. since they both are two different changes going into the same es5.... left it as unmerged.
just merged es5 into this branch now... so this prob line should be gone now..
merged. closing this. https://github.com/klahnakoski/ActiveData/pull/36
fix unit test, test_jx.test_groupby_1.TestgroupBy1.test_groupby_object