{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/19641","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19641/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19641/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19641/events","html_url":"https://github.com/elastic/elasticsearch/issues/19641","id":168002672,"number":19641,"title":"Adjacent wildcards in string query causes incorrect result","user":{"login":"518jelly","id":8968808,"avatar_url":"https://avatars.githubusercontent.com/u/8968808?v=3","gravatar_id":"","url":"https://api.github.com/users/518jelly","html_url":"https://github.com/518jelly","followers_url":"https://api.github.com/users/518jelly/followers","following_url":"https://api.github.com/users/518jelly/following{/other_user}","gists_url":"https://api.github.com/users/518jelly/gists{/gist_id}","starred_url":"https://api.github.com/users/518jelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/518jelly/subscriptions","organizations_url":"https://api.github.com/users/518jelly/orgs","repos_url":"https://api.github.com/users/518jelly/repos","events_url":"https://api.github.com/users/518jelly/events{/privacy}","received_events_url":"https://api.github.com/users/518jelly/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-28T02:48:56Z","updated_at":"2016-07-28T08:03:05Z","closed_at":"2016-07-28T08:03:05Z","body":"Elasticsearch version: 2.1.1\r\n\r\nJVM version: java version \"1.7.0_79\" (Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode))\r\n\r\nOS version: CentOS release 6.7 (Final)\r\n\r\nDescription of the problem including expected versus actual behavior:\r\nExpected correct results for query \"U??ZB4\", but the result always hits 0.\r\n\r\nSteps to reproduce:\r\n 1.\r\nexecute search:\r\n{\"query\":{\"bool\":{\"filter\":{\"bool\":{\"should\":{\"wildcard\":{\"plateno\":\"U?SZB4\"}}}}}}}\r\ngets correct results:\r\n\"hits\": { \"total\": 1,\"plateno\": \"UBSZB4\"}\r\n 2.\r\nexecute search:\r\n{\"query\":{\"bool\":{\"filter\":{\"bool\":{\"should\":{\"wildcard\":{\"plateno\":\"U??ZB4\"}}}}}}}\r\ngets incorrect results:\r\n\"hits\": { \"total\": 0}\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/235827134","html_url":"https://github.com/elastic/elasticsearch/issues/19641#issuecomment-235827134","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19641","id":235827134,"user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T08:03:05Z","updated_at":"2016-07-28T08:03:05Z","body":"I can't reproduce it with this script:\r\n\r\n```sh\r\ncurl -XDELETE \"localhost:9200/test?pretty\"\r\ncurl -XPUT \"localhost:9200/test/doc/1?pretty&refresh\" -d '{\r\n\t\"foo\": \"barbaz\"\r\n}'\r\ncurl -XGET \"localhost:9200/test/_search?pretty\" -d '{\r\n\t\"query\": {\r\n\t\t\"wildcard\": {\r\n\t\t\t\"foo\":\"bar?az\"\r\n\t\t}\r\n\t}\r\n}'\r\ncurl -XGET \"localhost:9200/test/_search?pretty\" -d '{\r\n\t\"query\": {\r\n\t\t\"wildcard\": {\r\n\t\t\t\"foo\":\"bar??z\"\r\n\t\t}\r\n\t}\r\n}'\r\n```\r\n\r\nMy guess is that because wildcard queries are not analyzed it does not give the expected result. Depends on your mapping as well.\r\n\r\nYou can follow up on discuss.elastic.co where we can help with this question.\r\nNot an issue. (tested in 5.0)"}}
{"actor":{"display_login":"dadoonet"}}