I am trying to query an Elasticsearch index by a time range, and additionally have a term match a specific string value.
I have tried this query, which seems pretty straightforward:
{
"query" : {
"bool": {
"must": [
{
"match": {
"method": "/customer/help"
}
},
{
"range" : {
"startTime": {
"from" : "2015-10-20T13:00-04:00",
"to" : "2015-10-20T14:00-04:00"
}
}
}
]
}
}
}
In this case, I want all of the documents within the given time range that also have a method value of "/customer/help"
.
In my results, I am receiving results that are within the time range, but I am getting documents that have various values for the "method"
field, when I just want results with "/customer/help"
in that field.