Skip to content

NEST Multiple aggregations does not work. #1474

@clintongormley

Description

@clintongormley

From @Ekenstein on June 30, 2015 10:22

I am trying to retrieve multiple aggregations through search with the following snippet of code:

        var searchDescriptor = new SearchDescriptor<Foo>();
        searchDescriptor
            .Take(50)
            .From(0)
            .Query(q => q
                .Filtered(filtered => filtered
                    .Query(fq => fq
                        .QueryString(qs => qs
                            .Query(query)
                        )
                    )
                    .Filter(filter => filter
                        .And(fs.ToArray())
                    )
                )
            )
            .Aggregations(aggs => aggs
                .Terms("categories", ct => ct
                    .Field("categories")
                    .Size(0)
                )
                .Terms("activities", at => at
                    .Field("activities")
                    .Size(0)
                )
                .GeoHash("locations", l => l
                    .Field(f => f.Location)
                    .GeoHashPrecision(GeoHashPrecision.Precision6)
                )
                .GeoBounds("bounds", b => b
                    .Field(f => f.Location)
                )
            );

When getting the corresponding json for this query and double check it with Sense I get all the aggregations, but the search response from NEST only contains the locations and the bounds aggregations.

Is this an issue or have I misunderstood something?

Copied from original issue: elastic/elasticsearch#11942

Metadata

Metadata

Assignees

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