Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Support nested aggregation #31

Closed
n1k0 opened this issue May 23, 2017 · 2 comments
Closed

Support nested aggregation #31

n1k0 opened this issue May 23, 2017 · 2 comments
Labels

Comments

@n1k0
Copy link

n1k0 commented May 23, 2017

I'm trying to aggregate distinct values for some nested property value:

{
  "aggs" : {
    "source_repos" : {
      "terms": {
        "field" : "source.tree",
        "size" : 1000
      }
    }
  }
}

Running this query, I get an empty object (but I think there's an issue about this already), and this error in the server logs:

Fielddata is disabled on text fields by default. Set fielddata=true on [source.tree] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

I'm no expert in ES, so I don't have any idea how I can do what is suggested here; thoughts?

@n1k0 n1k0 added the question label May 23, 2017
@leplatrem
Copy link
Contributor

That may be related to #8

@leplatrem
Copy link
Contributor

Ok I investigated a bit more about this.

By default ES infers types from data.

Doing aggregations for distinct values is very costly for text fields. In our case, our fields are more keywords values (like enums) than proper (full)text.

While fixing #8, we'll have to provide a way to specify the index (index:schema field on the collection metadata, like ui:schema) and we'll be able to specify our mapping types manually.

I close in favor of #8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants