How to fetch the distinct records from Elastic Search.
Eg:
field1 field2 field3
1 abc xyz
2 abc def
3 abc pqr
Now,iam searhing for xyz OR def OR pqr.
For these records field2 value is same.
now,Iam getting the 3 records(abc,abc,abc). But,I need only one
record(abc). Without iterating the searchHits.
In SearchHits it should consists only distinct records.
Take a look at facets. As long as, your data is indexed appropriately, it
will give you roll up counts of values for each field specified for a
query.
Best Regards,
Paul
On Monday, November 25, 2013 2:31:55 PM UTC-5, Elastic Sowjanya wrote:
How to fetch the distinct records from Elastic Search.
Eg:
field1 field2 field3
1 abc xyz
2 abc def
3 abc pqr
Now,iam searhing for xyz OR def OR pqr.
For these records field2 value is same.
now,Iam getting the 3 records(abc,abc,abc). But,I need only one
record(abc). Without iterating the searchHits.
In SearchHits it should consists only distinct records.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.