{"action":"opened","issue":{"url":"https://api.github.com/repos/danpaz/bodybuilder/issues/237","repository_url":"https://api.github.com/repos/danpaz/bodybuilder","labels_url":"https://api.github.com/repos/danpaz/bodybuilder/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/danpaz/bodybuilder/issues/237/comments","events_url":"https://api.github.com/repos/danpaz/bodybuilder/issues/237/events","html_url":"https://github.com/danpaz/bodybuilder/issues/237","id":497776030,"node_id":"MDU6SXNzdWU0OTc3NzYwMzA=","number":237,"title":"Issue with nested filters?","user":{"login":"rschick","id":423474,"node_id":"MDQ6VXNlcjQyMzQ3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/423474?v=4","gravatar_id":"","url":"https://api.github.com/users/rschick","html_url":"https://github.com/rschick","followers_url":"https://api.github.com/users/rschick/followers","following_url":"https://api.github.com/users/rschick/following{/other_user}","gists_url":"https://api.github.com/users/rschick/gists{/gist_id}","starred_url":"https://api.github.com/users/rschick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rschick/subscriptions","organizations_url":"https://api.github.com/users/rschick/orgs","repos_url":"https://api.github.com/users/rschick/repos","events_url":"https://api.github.com/users/rschick/events{/privacy}","received_events_url":"https://api.github.com/users/rschick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-09-24T15:50:56Z","updated_at":"2019-09-24T15:50:56Z","closed_at":null,"author_association":"NONE","body":"The nested filter example in the README isn't working for me:\r\n\r\n```javascript\r\nconst body = bodybuilder()\r\n    .orFilter('term', 'author', 'kimchy')\r\n    .orFilter('bool', b => b\r\n      .filter('match', 'message', 'this is a test')\r\n      .filter('term', 'type', 'comment')\r\n    )\r\n    .build();\r\n\r\nconsole.log(JSON.stringify(body, null, 2));\r\n```\r\n\r\nOutputs:\r\n\r\n```json\r\n{\r\n  \"query\": {\r\n    \"bool\": {\r\n      \"filter\": {\r\n        \"bool\": {}\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAccording to the README, the output should be:\r\n\r\n```\r\n// body == {\r\n//   query: {\r\n//     bool: {\r\n//       filter: {\r\n//         bool: {\r\n//           should: [\r\n//             { term: { author: 'kimchy' } },\r\n//             { bool: { must: [\r\n//               { match: { message: 'this is a test' } },\r\n//               { term: { type: 'comment' } }\r\n//             ] } }\r\n//           ]\r\n//         }\r\n//       }\r\n//     }\r\n//   }\r\n// }\r\n```\r\n\r\nAny idea what I'm doing wrong?\r\n"}}
{"actor":{"display_login":"rschick"}}