{"action":"opened","issue":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/495","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/495/comments","events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/495/events","html_url":"https://github.com/sksamuel/elastic4s/issues/495","id":123967885,"number":495,"title":"Question about filter with bool query : elastic4s : version 2.1.1","user":{"login":"ganeshvasudevan","id":11814804,"avatar_url":"https://avatars.githubusercontent.com/u/11814804?v=3","gravatar_id":"","url":"https://api.github.com/users/ganeshvasudevan","html_url":"https://github.com/ganeshvasudevan","followers_url":"https://api.github.com/users/ganeshvasudevan/followers","following_url":"https://api.github.com/users/ganeshvasudevan/following{/other_user}","gists_url":"https://api.github.com/users/ganeshvasudevan/gists{/gist_id}","starred_url":"https://api.github.com/users/ganeshvasudevan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ganeshvasudevan/subscriptions","organizations_url":"https://api.github.com/users/ganeshvasudevan/orgs","repos_url":"https://api.github.com/users/ganeshvasudevan/repos","events_url":"https://api.github.com/users/ganeshvasudevan/events{/privacy}","received_events_url":"https://api.github.com/users/ganeshvasudevan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-27T08:40:28Z","updated_at":"2015-12-27T08:40:28Z","closed_at":null,"body":"I write the query as below\r\n\r\nval queryForDebugging = search in \"items\" query { \r\nbool {\r\n      must (\r\n                matchQuery(\"name\", \"tom\")\r\n              )\r\n      filter (\r\n                rangeQuery(\"date\") from \"now/d\" to DateTime.now.plusYears(1),\r\n                geoDistanceQuery(\"distance\") distance (\"50km\") geohash (hash)\r\n              )\r\n        }\r\n}\r\n\r\nand generates\r\n{\r\n  \"query\" : {\r\n    \"bool\" : {\r\n      \"filter\" : [ {\r\n        \"range\" : {\r\n          \"when\" : {\r\n            \"from\" : \"now/d\",\r\n            \"to\" : \"2016-12-27T08:21:04.373Z\",\r\n            \"include_lower\" : true,\r\n            \"include_upper\" : true\r\n          }\r\n        }\r\n      }, {\r\n        \"geo_distance\" : {\r\n          \"hash\" : \"ud9x901f\",\r\n          \"distance\" : \"50km\"\r\n        }\r\n      } ]\r\n    }\r\n  }\r\n}\r\n\r\nWhy is the generated query missing the matchQuery for the name completely?\r\n\r\nIf I write the query like below,\r\nval queryForDebugging = search in \"items\" query { \r\nbool {\r\n      must (\r\n                matchQuery(\"name\", \"tom\"),\r\n               filter (\r\n                     rangeQuery(\"date\") from \"now/d\" to DateTime.now.plusYears(1),\r\n                     geoDistanceQuery(\"distance\") distance (\"50km\") geohash (hash)\r\n              )\r\n            )\r\n        }\r\n}\r\n\r\nThen it seems to generate the query with the matchQuery included. \r\nWhat is wrong with the first query? Is that the correct way to write or is the 2nd query the right one.\r\n\r\nThanks and regards\r\nGanesh"}}