# Elasticsearch does not find the result in the first search after the space character in NEST

**URL:** <https://discuss.elastic.co/t/elasticsearch-does-not-find-the-result-in-the-first-search-after-the-space-character-in-nest/268447>\
**Category:** Elasticsearch\
**Created:** [March 26, 2021, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-does-not-find-the-result-in-the-first-search-after-the-space-character-in-nest/268447 "2021-03-26T07:26:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celal\_Poyraz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celal_poyraz/32/85886_2.png) [@Celal\_Poyraz](https://discuss.elastic.co/u/Celal_Poyraz)\
**Post date:** [March 26, 2021, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-does-not-find-the-result-in-the-first-search-after-the-space-character-in-nest/268447/1 "2021-03-26T07:26:20Z")

</div>

I am indexing in elasticsearch as I share below. But after I do the indexing process, when I search in autocomplete, it finds the text I searched for before the space, but the first key I press after the space character does not perform the search operation. When I type the 2nd or 3rd character, it returns results. How can I do the search operation with the first character I press after the space character?

The code I added my data to elasticsearch to index.

```auto
var createIndexDescriptor = new CreateIndexDescriptor(INDEX_NAME).Mappings(ms => ms.Map<GlobalCompany>(m => m.AutoMap()
                  
                    .Properties(pprops => pprops
                        .Text(ps => ps
                            .Name("Title")
                            .Analyzer("whitespace")
                            .Fielddata(true)
                            .Fields(f => f
                                .Keyword(k => k
                                    .Name("keyword")
                                )
                            )
                        )
                    )
        ));

```

The code I searched from the data I indexed in elasticsearch.

```auto
var searchResponse = eClient.Search<GlobalCompany>(s => s.Index(INDEX_NAME)
                  .Query(q => q
                  .MultiMatch(m => m
                            .Fields(f => f
                             .Field(u => u.Title)
                             .Field(u => u.RegisterNumber))
                            .Type(TextQueryType.PhrasePrefix)
                          .Query(value))));

```

---

<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:** [April 23, 2021, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-does-not-find-the-result-in-the-first-search-after-the-space-character-in-nest/268447/2 "2021-04-23T07:26:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
