Getting all the distinct values of a field

Hi Team,

One of our use cases is to get all the distinct values of a particular field. For e. g. if we are querying against Oracle database we can execute below query :

select distinct column_name from table_name

The above query gives us all the distinct values of column 'column_name' from the table 'table_name'.

We need something similar in Elastic Search. Please provide inputs on how this can be achieved in Elastic Search Java API.

Thanks..

If the column_name is indexed with a keyword analyzer then you can
facet over that field:

Peter.

On 19 Jan., 09:13, ElasticUsers kranti_...@rediffmail.com wrote:

Hi Team,

One of our use cases is to get all the distinct values of a particular
field. For e. g. if we are querying against Oracle database we can execute
below query :

select distinct column_name from table_name

The above query gives us all the distinct values of column 'column_name'
from the table 'table_name'.

We need something similar in Elastic Search. Please provide inputs on how
this can be achieved in Elastic Search Java API.

Thanks..

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/Getting-all-the-disti...
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

There was a discussion about this functionality not too long ago and
an issue was opened:

On Thu, Jan 19, 2012 at 1:40 AM, Karussell tableyourtime@googlemail.com wrote:

If the column_name is indexed with a keyword analyzer then you can
facet over that field:

Elasticsearch Platform — Find real-time answers at scale | Elastic

Peter.

On 19 Jan., 09:13, ElasticUsers kranti_...@rediffmail.com wrote:

Hi Team,

One of our use cases is to get all the distinct values of a particular
field. For e. g. if we are querying against Oracle database we can execute
below query :

select distinct column_name from table_name

The above query gives us all the distinct values of column 'column_name'
from the table 'table_name'.

We need something similar in Elastic Search. Please provide inputs on how
this can be achieved in Elastic Search Java API.

Thanks..

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/Getting-all-the-disti...
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Hi all just want to ask if what if the unique values that im currently querying distinct values on ES has special characters.

example:

"user090@sample.com"

it doesn't get the exact value, it gets the count separately for user090, sample, com