# Complete suggestion ignore spaces

**URL:** https://discuss.elastic.co/t/complete-suggestion-ignore-spaces/85633
**Category:** Elasticsearch
**Created:** [May 13, 2017, 7:56am UTC](https://discuss.elastic.co/t/complete-suggestion-ignore-spaces/85633 "2017-05-13T07:56:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mlkmhd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mlkmhd/32/22385_2.png) [@mlkmhd](https://discuss.elastic.co/u/mlkmhd)
#### Post date: [May 13, 2017, 7:56am UTC](https://discuss.elastic.co/t/complete-suggestion-ignore-spaces/85633/1 "2017-05-13T07:56:36Z")

</div>

when I'm using `Completion Suggester`, it ignores spaces. for example if I search `foo b` the result isn't contains `foo bar` but when I search for `fo` the result contains `foo bar`

this is my index mapping:

```
     {
        "mappings": {
          "tag": {
            "properties": {
              "suggest": {
                "type": "completion",
                "analyzer": "simple",
                "preserve_separators": true,
                "preserve_position_increments": true,
                "max_input_length": 50
              }
            }
          }
        }
    }

```

my request:

```
POST http://localhost:9200/index/_search
    {
      "suggest": {
        "tag_suggests": {
          "prefix": "foo f",
          "completion": {
            "field": "suggest"
          }
        }
      }
    }

```

and the result not contains `foo bar`. but when I search for `foo` the result contails `foo bar` !

---

<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: [June 10, 2017, 8:06am UTC](https://discuss.elastic.co/t/complete-suggestion-ignore-spaces/85633/2 "2017-06-10T08:06:10Z")

</div>

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