I try to convert a sql search query to elasticsearch query from elasticsearch documantation, but samething are worng anyone can help me?
I have a document with same fields like age and city. i need search a people with 40 years old and don't live in the city Umapine.
My mysql code is samething like this:
SELECT *
FROM bank
WHERE age = 40 and city != Umapine
and in elasticsearch code i try to do samething like this:
{
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"should" : { "term" : {"age" : 40} },
"must_not" : { "term" : {"city" : "Umapine"} }
}
}
}
}
}
But samething are worng, anyone know what is worng?