# Elasticsearch space character problem

**URL:** <https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506>\
**Category:** Elasticsearch\
**Created:** [March 26, 2021, 1:51pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506 "2021-03-26T13:51:17Z")\
**Posts on this page:** 5\
**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, 1:51pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506/1 "2021-03-26T13:51:17Z")

</div>

I do elasticsearch indexing, but the first 2 characters after the space character do not search. For example, when I search for "John", the results come, but when I search for "John S", the result is not available. The number is 4.5 million data. Then I indexed another 250 registered data. When I run this, it does the search process without any problems with whitespace characters. I use C # with the NEST library. Have an idea?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 26, 2021, 1:56pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506/2 "2021-03-26T13:56:57Z")

</div>

It's impossible to answer without knowing the details, like the mapping, the type of query you are running, etc...

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste **in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<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, 2:24pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506/3 "2021-03-26T14:24:17Z")

</div>

sorry i fixed the type would prefix. Please help.  
this query is the total result 0

```auto
GET searchdemoelastic/_search 
{
  "from" : 0,
  "size" : 10,

  "query": {
        "multi_match" : {
          "query": "bozkar d",
          "type": "phrase_prefix",
          "fields": ["title", "registernumber"]
        }
  }
}

```

but this way the result comes.

```auto
GET searchdemoelastic/_search 
{
  "from" : 0,
  "size" : 10,

  "query": {
    
      
        "multi_match" : {
          "query": "bozkar den",
          "type": "phrase_prefix",
          "fields": ["title", "registernumber"]
        }
  }
}

```

this is my code in c#

```auto
 var searchResponse = eClient.Search<GlobalCompany>(s => s.Index(INDEX_NAME).From(0).Size(10)
                  .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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 26, 2021, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506/4 "2021-03-26T15:21:05Z")

</div>

Any chance we can get a full script with data, index mapping if any, etc so we can just run it from Kibana Dev Console as I asked? See again [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) for an example.

---

<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, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-space-character-problem/268506/5 "2021-04-23T15:21:44Z")

</div>

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