# Completion Suggester: Mutiple tokens?

**URL:** <https://discuss.elastic.co/t/completion-suggester-mutiple-tokens/171154>\
**Category:** Elasticsearch\
**Created:** [March 6, 2019, 4:54pm UTC](https://discuss.elastic.co/t/completion-suggester-mutiple-tokens/171154 "2019-03-06T16:54:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxi\_Huber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maxi_huber/32/20893_2.png) [@Maxi\_Huber](https://discuss.elastic.co/u/Maxi_Huber)\
**Post date:** [March 6, 2019, 4:54pm UTC](https://discuss.elastic.co/t/completion-suggester-mutiple-tokens/171154/1 "2019-03-06T16:54:32Z")

</div>

As stated [here](https://medium.com/@mourjo_sen/a-detailed-comparison-between-autocompletion-strategies-in-elasticsearch-66cb9e9c62c4) a field in Elasticsearch, defined as type "completion" together with a certain analyzer + tokenizer, is first split up according to the underlying logic of those parts and then "stitched" together again. However I'm verry unhappy with this behaviour.

This is my current mapping setup (excerpt):

```auto
"mappings": {
    "movie": {
      "properties": {
        "title": {
          "analyzer": "standard",
          "fields": {
            "autocomplete": {
              "type": "completion"
              "analyzer": "whitespace",
            }
          },
          "type": "string"
        }
      }
    }
}

```

Let's take a movie with the title `Harry Potter` for example:

When I enter the prefix `Har` I get the suggestion `Harry Potter` . When I enter `Pot` instead, I get no result at all, because the individual tokens `Harry` and `Potter` were stitched together to `Harry Potter` immediately after analyzing/tokenizing.

Now what I would like is the following behaviour: When I enter `Pot` I'd want the Completion Suggester to return `Potter` . Not `Harry Potter` , but simply `Potter` . Is this somehow possible? Caution: I don't even need the reference to the document which created the suggestion. So if it's somehow possible to throw all generated tokens in a pot and then retrieve suggestions from there, that would be awesome (due to some other stuff I have to do).

---

<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 3, 2019, 4:54pm UTC](https://discuss.elastic.co/t/completion-suggester-mutiple-tokens/171154/2 "2019-04-03T16:54:33Z")

</div>

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