-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Hello,
When I use the code
dateFilter := NewBoolQuery()
dateFilter = dateFilter.Filter(NewRangeQuery("ts").Gte("now-24h/d"))
dateFilter = dateFilter.Filter(NewRangeQuery("ts").Gte("now-24h"))
I was only expecting the gte
keyword to be used. But I see
"from": "now-24h/d",
"include_lower": true,
"include_upper": true,
"to": null
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html also explains only about gte
. Is there a reason why you convert to these values. Also, I was trying to find in ES Reference of range query. Is this mentioned somewhere in docs.
Full Query below:
{
"bool": {
"_name": "Test",
"filter": {
"bool": {
"filter": [
{
"term": {
"singer": "Michael"
}
},
{
"term": {
"kind": "rock"
}
}
]
}
},
"must": {
"has_child": {
"inner_hits": {
"fields": "ts",
"name": "ts",
"size": 1,
"sort": [
{
"ts": {
"order": "desc"
}
}
]
},
"query": {
"bool": {
"filter": {
"bool": {
"filter": [
{
"range": {
"ts": {
"from": "now-24h/d",
"include_lower": true,
"include_upper": true,
"to": null
}
}
},
{
"range": {
"ts": {
"from": "now-24h",
"include_lower": true,
"include_upper": true,
"to": null
}
}
}
]
}
},
"must": {
"match_all": {}
}
}
},
"score_type": "sum",
"type": "music"
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels