I tried to simulate my date with the following table. But what I want out of it is three records containing City & State.
e.g. Lets original data will look like,
|ID|Product|Price|City|State|
|100|ABC|$201|Seattle|WA|
|101|XUY|$423|Seattle|WA|
|102|DEF|$252|Atlanta|GA|
|103|GEY|$325|Chicago|IL|
|104|BDV|$263|Atlanta|GA|
and what I expect finally is:
|City|State|
|Seattle|WA|
|Atlanta|GA|
|Chicago|IL|
Could you please help me get a query or suggest something?
I used a table instead of JSON for display pupose
Thank you.
"_source": is only limiting the result to the fields i want to return.
and applying aggs like this:
"aggs" : {
"by_city": {
"terms": {
"field": "city.keyword"
}
}
}
doesn't update the hits but it returns separate buckets for each aggregate. Am I doing something wrong? The ultimate goal is I want the distinct records that I could eventually paginate over.
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.