Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not support bool query and bool filter? #240

Open
evilyzou opened this issue Sep 18, 2015 · 2 comments
Open

not support bool query and bool filter? #240

evilyzou opened this issue Sep 18, 2015 · 2 comments

Comments

@evilyzou
Copy link

not support bool query and bool filter?

@xrl
Copy link

xrl commented Jan 12, 2016

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
Copy link

xrl commented Jan 13, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants