Skip to content

NEST Multiple aggregations does not work. #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clintongormley opened this issue Jun 30, 2015 · 2 comments
Closed

NEST Multiple aggregations does not work. #1474

clintongormley opened this issue Jun 30, 2015 · 2 comments
Assignees

Comments

@clintongormley
Copy link
Contributor

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

@Ekenstein
Copy link

If GeoBounds is removed it seems to work. However, if GeoBounds aggregation is added, I only get activities and the bounds aggregation from the response.

@gmarz gmarz self-assigned this Jun 30, 2015
@gmarz gmarz added Bug labels Jun 30, 2015
@gmarz gmarz closed this as completed in ab4b4b8 Jun 30, 2015
@gmarz
Copy link
Contributor

gmarz commented Jun 30, 2015

@Ekenstein thanks for reporting this, I just pushed a fix.

gmarz added a commit that referenced this issue Jul 10, 2015
@gmarz gmarz added v1.7.0 and removed v1.6.2 labels Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants