elastigo
elastigo copied to clipboard
not support bool query and bool filter?
not support bool query and bool filter?
That's what I'm seeing, it's not supported. I need to do a query like:
curl -XGET http://localhost:9200/my-index/_search?pretty=true -d '{
"query": {
"filtered": {
"filter": {
"bool": {
"must": {
"range": {
"timestamp": {
"gte": "2016/03/28 00:00:00",
"lte": "2016/04/11 00:00:00"
}
}
},
"should": [
{ "term":
{
"app": "Foo"
}
},
{ "term":
{
"app": "Bar"
}
}
]
}
}
}
}
}
Looks like I'll be hacking my vendor'd copy of elastigo.
Perhaps my branch has some useful bits for Bool filters: https://github.com/tureus/elastigo
Usage:
filter := es.Filter()
rangeFilter := es.Filter().Range("timestamp", startDate, nil, endDate, nil, "")
var boolQuery *es.BoolQuery = es.NewBool()
boolQuery.Must(rangeFilter).Should(es.Filter().Term("a_property","foo"))