dncrews / angular-elastic-builder

This is an Angular.js directive for building an Elasticsearch query. You just give it the fields and can generate a query for it.
Other
83 stars 38 forks source link

parsing_exception #13

Open bapzangbo opened 7 years ago

bapzangbo commented 7 years ago

hihi @dncrews i have use your example to build query like that

{
    "size": 10,
    "filter": {
        "and": [
            {
                "term": {
                    "appkey": "710659"
                }
            }
        ]
    }
}

and i receive error when using https://github.com/elastic/elasticsearch-js { "error": { "root_cause": [ { "type": "parsing_exception", "reason": "Unknown key for a START_OBJECT in [filter].", "line": 1, "col": 21 } ], "type": "parsing_exception", "reason": "Unknown key for a START_OBJECT in [filter].", "line": 1, "col": 21 }, "status": 400 }

But when im modify the query like that, im fine

{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "appkey": "710569"
          }
        }
      ]
    }
  },
  "size": 10
}

so you can suggest me how can fix that when using your project

bapzangbo commented 7 years ago

update: I have error when using lastes version of elastic kibana version 5.0.0