{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/15174","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15174/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15174/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15174/events","html_url":"https://github.com/elastic/elasticsearch/issues/15174","id":119891330,"number":15174,"title":"`phase_slop` question","user":{"login":"feifeiiiiiiiiiii","id":3310967,"avatar_url":"https://avatars.githubusercontent.com/u/3310967?v=3","gravatar_id":"","url":"https://api.github.com/users/feifeiiiiiiiiiii","html_url":"https://github.com/feifeiiiiiiiiiii","followers_url":"https://api.github.com/users/feifeiiiiiiiiiii/followers","following_url":"https://api.github.com/users/feifeiiiiiiiiiii/following{/other_user}","gists_url":"https://api.github.com/users/feifeiiiiiiiiiii/gists{/gist_id}","starred_url":"https://api.github.com/users/feifeiiiiiiiiiii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feifeiiiiiiiiiii/subscriptions","organizations_url":"https://api.github.com/users/feifeiiiiiiiiiii/orgs","repos_url":"https://api.github.com/users/feifeiiiiiiiiiii/repos","events_url":"https://api.github.com/users/feifeiiiiiiiiiii/events{/privacy}","received_events_url":"https://api.github.com/users/feifeiiiiiiiiiii/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Highlighting","name":":Highlighting","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/feedback_needed","name":"feedback_needed","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-02T08:31:36Z","updated_at":"2015-12-02T12:08:33Z","closed_at":null,"body":"I add `phase_slop` in `query_string`, the query dsl as follow:\r\n```\r\n{\r\n   \"query\": {\r\n      \"bool\": {\r\n         \"must\": [\r\n           {\r\n             \"term\": {\r\n               \"platform\": 0\r\n             }\r\n           },\r\n            {\r\n               \"query_string\": {\r\n                  \"default_field\": \"text\",\r\n                 \r\n                  \"query\": \"\\\"美丽的蓝色多瑙河\\\"\",\r\n                 \"phrase_slop\": 1\r\n               }\r\n            }\r\n         ]\r\n      }\r\n   },\r\n  \"highlight\": {\r\n    \"fields\": {\r\n      \"text\": {\r\n        \"fragment_size\": 150\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\nBut I get shard failures result as follows:\r\n```\r\n{\r\n    \"took\": 528,\r\n    \"timed_out\": false,\r\n    \"_shards\": {\r\n        \"total\": 30,\r\n        \"successful\": 29,\r\n        \"failed\": 1,\r\n        \"failures\": [\r\n            {\r\n                \"index\": \"listening_v2_201511\",\r\n                \"shard\": 7,\r\n                \"status\": 500,\r\n                \"reason\": \"RemoteTransportException[[es13][inet[/10.10.3.98:9300]][indices:data/read/search[phase/fetch/id]]]; nested: FetchPhaseExecutionException[[listening_v2_201511][7]: query[filtered(+platform:[0 TO 0] +(text:\\\"美丽 丽 蓝色 蓝 色 多瑙河 河\\\"~1))->cache(org.elasticsearch.index.search.nested.NonNestedDocsFilter@b5b6c454)],from[0],size[10]: Fetch Failed [Failed to highlight field [text]]]; nested: StringIndexOutOfBoundsException[String index out of range: -1]; \"\r\n            }\r\n        ]\r\n    },\r\n    \"hits\": {\r\n        \"total\": 117,\r\n        \"max_score\": 87.00564\r\n    ...\r\n```\r\nHow solve it?"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/161273145","html_url":"https://github.com/elastic/elasticsearch/issues/15174#issuecomment-161273145","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15174","id":161273145,"user":{"login":"clintongormley","id":56599,"avatar_url":"https://avatars.githubusercontent.com/u/56599?v=3","gravatar_id":"","url":"https://api.github.com/users/clintongormley","html_url":"https://github.com/clintongormley","followers_url":"https://api.github.com/users/clintongormley/followers","following_url":"https://api.github.com/users/clintongormley/following{/other_user}","gists_url":"https://api.github.com/users/clintongormley/gists{/gist_id}","starred_url":"https://api.github.com/users/clintongormley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clintongormley/subscriptions","organizations_url":"https://api.github.com/users/clintongormley/orgs","repos_url":"https://api.github.com/users/clintongormley/repos","events_url":"https://api.github.com/users/clintongormley/events{/privacy}","received_events_url":"https://api.github.com/users/clintongormley/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T12:08:33Z","updated_at":"2015-12-02T12:08:33Z","body":"This works for me in 1.7.0 and 2.1.0:\r\n\r\n    PUT t/t/1\r\n    {\r\n      \"text\": \"\\\"美丽的蓝色多瑙河\\\"\",\r\n      \"platform\": 0\r\n    }\r\n    \r\n    GET _search\r\n    {\r\n       \"query\": {\r\n          \"bool\": {\r\n             \"must\": [\r\n               {\r\n                 \"term\": {\r\n                   \"platform\": 0\r\n                 }\r\n               },\r\n                {\r\n                   \"query_string\": {\r\n                      \"default_field\": \"text\",\r\n    \r\n                      \"query\": \"\\\"美丽的蓝色多瑙河\\\"\",\r\n                     \"phrase_slop\": 1\r\n                   }\r\n                }\r\n             ]\r\n          }\r\n       },\r\n      \"highlight\": {\r\n        \"fields\": {\r\n          \"text\": {\r\n            \"fragment_size\": 150\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\nPlease could you provide a full recreation of the problem, plus the stack trace that you're seeing in the logs, and the version of ES that you're using."}}