Query in Elasticsearch for retrieving strings that start with a particular word
<p>I want to write a query in elasticsearch such that it will only give results where string starts from a particular word for example i have one string "Donald Duck" and the other string which is "Alan Donald" now if i will search for "Donald" with below query</p>

<pre><code>"query": {
     query_string: {
         query: "Donald",
         fields: ['character_name']
     }
 }
</code></pre>

<p>then result should be "Donald Duck" not "Alan Donald" because in "Donald Duck" it starts with "Donald". Now can anyone please tell me how can i write such a query, i have searched a lot of posts but haven't found any solution.</p>

<p>Edit-1 </p>

<p>My mapping is given below</p>

<pre><code>"settings": {
        "index": {
                "analysis": {
                    "analyzer": {
                        "simple_wildcard": {
                    "tokenizer": "whitespace",
                    "filter": ["lowercase"]
                        }
                    }
                }
            }
      },
      "mappings" : {
        "college": {
                "properties":{
                    "character_name" : { "type" : "string", "index": "analyzed", "analyzer": "simple_wildcard"}

                }
            }
}
</code></pre>