Skip to content

聚合字段为内嵌类型,聚合查询不正确 #527

@fireflyhoo

Description

@fireflyhoo

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" } } } }

测试地点 http://www.nlpcn.org:9999/web/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions