Closed maggienj closed 7 years ago
The or filter is replaced in favour of the bool query.
So, in the above query, "or" and "and" should be removed.
-- Will have to try with "should" for "or"
-- and
-- Will have to try with "must" for "and"
-- will have to change the query as a bool query.
Ref: https://github.com/yiisoft/yii2-elasticsearch/issues/41
https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-or-filter.html
And / Or / Not have been deprecated and replaced with bool filter. https://github.com/elastic/elasticsearch/issues/8960
This is an agg.... so i guess, conversion to "bool" is not required in this context.
I guess, this aggregation looks like a "multi-bucket" aggregation and therefore we could use the "filters" aggregation...
But, I remember that our goal is to bucket one document into ONE bucket only... (i.e.) the same document cannot be put into two buckets.... so.. one document MUST be put into ONE and ONLY one bucket. Having said that, I'm not sure, if the above referenced doc related to "filters aggregation" would satisfy that condition.
{
"aggs": {
"_match": {"terms": {
"field": "a",
"include": ["c"],
"size": 1
}},
"_missing": {"filter": {"or": [
{"missing": {"field": "a"}},
{"not": {"terms": {"a": ["c"]}}}
]}}
},
"size": 1
}
There are two buckets in this aggregation. The first bucket by name "_match" is using "terms" clause. and the second bucket by name "_missing" is using "filter" clause.
So, it looks like that the first bucket is a "terms aggregation" and the second bucket is a "filter aggregation".
Since this issue is covering TestEdge1.test_count_rows, and you already have a bug for that, I suggest closing it. Or, you might want to rename this issue with a prefix "For journal entry - " like you have done the others.
renamed.
UnitTest: TestEdge1.test_count_rows