Kuldeep1
(Kuldeep)
May 26, 2017, 12:09pm
1
I am looking for elastic search query equivalent to mysql query as below:-
SELECT *, COUNT(ID) FROM EMP GROUP BY ID HAVING COUNT(ID) > 3 ORDER BY ID DESC;
Below Elastic search Query i am using:-
curl -XGET 'localhost:9200/emp/_search?pretty' -H 'Content-Type: application/json' -d'`enter code here`
{
"aggs": {
"group_by_id": {
"terms": {
"field": "id",
"min_doc_count" : 3
}
}
}
}'
but its returning only id value and doc_count.If i mentioned size in it then its returning _source field with data but its return rows one by one.
I need all fields with last inserted record same as my sql query returing means only single row for particular id.
Please help.
Kuldeep1
(Kuldeep)
May 26, 2017, 12:10pm
2
PLEASE UPDATE ITS CRITICAL FOR ME.
Please be patient. This forum is staffed by volunteers, so give users time to respond. If there has been no response in a day or two, feel free to bump the question.
Kuldeep1
(Kuldeep)
May 26, 2017, 12:13pm
4
Thanks Christian_Dahlqvist i am new with elastic search and forum also.I will wait thanks for suggest.
Kuldeep1
(Kuldeep)
May 28, 2017, 5:19am
5
Any genius please update..its already too late.
dadoonet
(David Pilato)
May 28, 2017, 6:13am
6
Please read About the Elasticsearch category
If you need support with service level agreement then you can buy support from elastic.
Otherwise be patient as written in the post I linked to.
Remember that lot of people don't work on Saturday and Sunday.
1 Like
system
(system)
Closed
June 25, 2017, 6:13am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.