Hi,
I am newbie to elasticsearch. I have written the following two queries on my existing elasticsearch index.
Query 1:
{
"size" : 100,
"from" : 0,
"query": {
"bool": {
"must": [
{ "match": { "eu_name": "ARTEA AG REG TOSCANA EROGAZ AGRIC" }},
{
"nested": {
"path": "SUPPORT",
"query": {
"bool": {
"must": [
{ "match": { "SUPPORT.ticket_id": "77098"}}
]
}
}
}
}
]
}
}
}
Query 2:
{
"size" : 100,
"from" : 0,
"query": {
"bool": {
"must": [
{ "match": { "eu_name": "ARTEA AG REG TOSCANA EROGAZ AGRIC" }},
{
"nested": {
"path": "SUPPORT",
"query": {
"bool": {
"must": [
{ "match": { "SUPPORT.ticket_id": "77098"}}
]
}
},
"filter": {
"range": {
"SUPPORT.closed_Dt": {
"gt": "2015-02-13"
}
}
}
}
}
]
}
}
}
"Query 1" is giving the result having the 1 document. Here Query 1 is formed without applying the filter.
"Query 2" is giving the result having the 2 documents. Here Query 2 is formed by applying the filter.
I am wondering why the "Query 2" has given 2 document after applying the filter.
I am really wondering!!!
It would be greatly appreciated if any expert can throw some light on this magical problem.
Thank You!
Regards,
Samanth