elastigo icon indicating copy to clipboard operation
elastigo copied to clipboard

not support bool query and bool filter?

Open evilyzou opened this issue 9 years ago • 2 comments

not support bool query and bool filter?

evilyzou avatar Sep 18 '15 00:09 evilyzou

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.

xrl avatar Jan 12 '16 17:01 xrl

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"))

xrl avatar Jan 13 '16 00:01 xrl