Hey I'm new to Elasticsearch and want to "translate" this SQL query :
SELECT"*" FROM Results WHERE "Id"=2 AND Number IN (25,27, 29) AND Date BETWEEN Date1 AND Date 2 ORDER BY Date LIMIT 20
EDIT: By "translate" I mean i want to convert the SQL statement to an elaticsearch query. I tried that but the elasticsearch query below isn't working yet :(
I wanted to do this using filters and I've got so far:
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"and": [
{
"range": {
"date": {
"gt": "2008-01-01",
"lt": "2014-01-01"
}
}
},
{
"term": {
"Id": 2
}
},
{
"terms": {
"number": [
25,
27,
29
]
}
},
{
"limit": {
"value": 20
}
}
]
}
}
}
I read the docs and tried examples, made simple queries, I hope somebody can help me with this!