Skip to content

Nested Filter does not allow .Filter only filter #880

Closed
@Philo

Description

@Philo

The below query should be supported by NEST, however it results in a conditionless filter being produced.

                Filter<Document>.Nested(n => n
                    .Path("nested_property")
                    .Filter(f => f
                        .Term("nested_property.path", "myvalue")
                    )
                    );
    "filter": {
        "nested": {
           "path": "nested_property",
           "filter" : {
               "term": {
                  "nested_property.path": "myvalue"
               }
        }
    }
}

A workaround is to ensure that you include a .Query(q => q.MatchAll()) within your nested filter.

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