elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.49k stars 24.89k forks source link

Facet between two non numeric fiels #3383

Closed nmaillard closed 10 years ago

nmaillard commented 11 years ago

Hi great piece of software

I have been playing around witht the facets and I can't seem to find a way to do the following action: I would like to count distinct values of field bucketed on another field. Say I want to count the number of different ip addresses for a given user.

I have looked at histogram where my key would be user and value would be IP but IP is not numeric.

Is there a way to do this and have I missed the obvious should I look into making a custom facet is this to memory consuming.

mattweber commented 11 years ago

I think you are looking for aggregations:

https://github.com/elasticsearch/elasticsearch/issues/3300

This functionality is targeted for ES 1.0.

uboness commented 11 years ago

@nmaillard, as @mattweber mentioned the future aggregations module will enable you to build your custom "views" and build different types of aggregations. That said, we currently don't have an aggregation dedicated for returning unique value counts per bucket (we do plan to add it, though for high cardinality fields it will be close estimation rather than an exact count)

nmaillard commented 11 years ago

thanks for all the replies good news i'll eagerly be waiting for es 1.0 then Any idea at all on the roadmap

clintongormley commented 10 years ago

The cardinality agg is now available. Closing