-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
SELECT count(DISTINCT nested(a.id)) FROM myindex where (nested(a.b)>0 and nested(a.e) > 0) and nested(c.e) is not null and nested('comments', comments.message = 'hello' and comments.likes > 3) limit 100 ,1000
{ "from": 0, "size": 0, "query": { "bool": { "must": { "bool": { "must": [ { "nested": { "query": { "range": { "a.b": { "from": 0, "to": null, "include_lower": false, "include_upper": true } } }, "path": "a" } }, { "nested": { "query": { "range": { "a.e": { "from": 0, "to": null, "include_lower": false, "include_upper": true } } }, "path": "a" } }, { "nested": { "query": { "bool": { "must_not": { "missing": { "field": "c.e" } } } }, "path": "c" } }, { "nested": { "query": { "bool": { "must": { "bool": { "must": [ { "match": { "comments.message": { "query": "hello", "type": "phrase" } } }, { "range": { "comments.likes": { "from": 3, "to": null, "include_lower": false, "include_upper": true } } } ] } } } }, "path": "comments" } } ] } } } }, "_source": { "includes": [ "COUNT" ], "excludes": [] }, "aggregations": { "COUNT(DISTINCT nested=org.nlpcn.es4sql.parse.NestedType@51a83ced)": { "cardinality": { "field": "org.nlpcn.es4sql.parse.NestedType@51a83ced" } } } }