# ElasticSearch-NEST Query String Phrase

**URL:** <https://discuss.elastic.co/t/elasticsearch-nest-query-string-phrase/27902>\
**Category:** Elasticsearch\
**Created:** [August 23, 2015, 5:03pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-query-string-phrase/27902 "2015-08-23T17:03:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stormcloak](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@stormcloak](https://discuss.elastic.co/u/stormcloak)\
**Post date:** [August 23, 2015, 5:03pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-query-string-phrase/27902/1 "2015-08-23T17:03:11Z")

</div>

I have a problem with ElasticSearch query phrases. My index document is;

```
    var person = new Person
    {
        Id = "4",
        Firstname = "ali ahmet",
        Lastname = "yazıcı"
    };

var index = client.Index(person, x => x.Index("personindex"));

```

My search phrase is;

```
    var result = client.Search<Person>(s => s
        .From(0)
        .Size(10)
        .Query(q => q
            .SimpleQueryString(qs => qs
                .OnFields(new[]{"firstname","lastname"})
                .Query("\"ali ah*\"")
            )
        )
  );
indent preformatted text by 4 spaces

```

Result document is empty. But when i change my phrase to

```
.Query("\"ali ahmet\"")

```

result is coming. Why return empty result from

```
.Query("\"ali ah*\"")

```

this phrase. Word order is very important for me. First word must be "ali" and second word must be "ah\*".

ALSO

**Person Class**

```
public class Person
{
    public string Id { get; set; }
    public string Firstname { get; set; }
    public string Lastname { get; set; }
}

```

**Index mapping**

```
var response = client.CreateIndex("personindex", c => c
            .AddMapping<Person>(m => m.MapFromAttributes())
```

---

<div class="post-metadata">

**Author:** ![ea\_fox](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@ea\_fox](https://discuss.elastic.co/u/ea_fox)\
**Post date:** [August 23, 2015, 8:14pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-query-string-phrase/27902/2 "2015-08-23T20:14:55Z")

</div>

try to use queryContainer and QueryString, this can help 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:54pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-query-string-phrase/27902/3 "2017-07-05T23:54:20Z")

</div>


