# Phrase suggester not capable of removing whitespace ("marktp latz" =\> "marktplatz")

**URL:** <https://discuss.elastic.co/t/phrase-suggester-not-capable-of-removing-whitespace-marktp-latz-marktplatz/184823>\
**Category:** Elasticsearch\
**Created:** [June 8, 2019, 5:15am UTC](https://discuss.elastic.co/t/phrase-suggester-not-capable-of-removing-whitespace-marktp-latz-marktplatz/184823 "2019-06-08T05:15:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkamel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mrkamel/32/15829_2.png) [@mrkamel](https://discuss.elastic.co/u/mrkamel)\
**Post date:** [June 8, 2019, 5:15am UTC](https://discuss.elastic.co/t/phrase-suggester-not-capable-of-removing-whitespace-marktp-latz-marktplatz/184823/1 "2019-06-08T05:15:28Z")

</div>

Hi,

the phrase suggester does not seem to be capable of removing erroneously introduced whitespace.  
E.g. `marktp latz` =\> gives no suggestions, while for `marktp_latz => marktplatz` actually is suggested.  
The same for all cases where additional whitespace needs to be removed.

The term suggester however, is capable of suggesting `marktp latz => marktplatz`.

I played with all params of the phrase suggester without luck (confidence, max\_errors, etc). Is it a limitation or am i doing something wrong?

index setup:

```
  {   
    settings: {
      analysis: {
        analyzer: {   
          suggest: {
            type: 'custom',
            tokenizer: 'standard',
            filter: [   
              'lowercase',
              'shingle_filter'
            ]
          }
        },
        filter: {   
          shingle_filter: {
          type: 'shingle',
          min_shingle_size: 2,
          max_shingle_size: 3
        }
      }
   }

```

mapping:

```
    ...
    suggestions: {
      properties: {
        de: { type: 'text', analyzer: 'suggest' },
        en: { type: 'text', analyzer: 'suggest' },
        fr: { type: 'text', analyzer: 'suggest' }
      }
    }
   ...

```

query:

```
  "suggest": {
    "my_suggestions": {
      "text": "markt platz",
      "phrase": {
        "field": "suggestions.de"
      }
    }
  }
}

```

Thx in advance

---

<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 6, 2019, 5:15am UTC](https://discuss.elastic.co/t/phrase-suggester-not-capable-of-removing-whitespace-marktp-latz-marktplatz/184823/2 "2019-07-06T05:15:32Z")

</div>

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