Hello,
Please any one will help me out with converting mysql queries to elasticsearch.
I have this query :
SELECT DISTINCT (email) FROM my_table
Is it possible?
@polyfractal
Thanks
Hello,
Please any one will help me out with converting mysql queries to elasticsearch.
I have this query :
SELECT DISTINCT (email) FROM my_table
Is it possible?
@polyfractal
Thanks
I'm trying it using PHP api, but no success
My ES query :
$aFindCountries = array();
$aFindCountries['index'] = 'my_table';
$aFindCountries['type'] = 'data';
$aFindCountries['body'] = array(
'size' => 0,
'query' => array(
'filtered' => array(
'query' => array(
'query_string' => array(
'query' => '*',
'analyze_wildcard' => true
)
)
)
),
'aggs' => array(
'Distinct' => array(
'terms' => array(
'field' => 'user_country',
'size' => 155,
'order' => 'desc'
)
)
),
);
I want to find the distinct country names from my_table;
Thanks
© 2020. All Rights Reserved - Elasticsearch
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.