# How to use completion suggester and edge NGram Tokenizer function together?

**URL:** <https://discuss.elastic.co/t/how-to-use-completion-suggester-and-edge-ngram-tokenizer-function-together/122534>\
**Category:** Elasticsearch\
**Created:** [March 5, 2018, 2:38pm UTC](https://discuss.elastic.co/t/how-to-use-completion-suggester-and-edge-ngram-tokenizer-function-together/122534 "2018-03-05T14:38:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kurzer\_Patrick](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@Kurzer\_Patrick](https://discuss.elastic.co/u/Kurzer_Patrick)\
**Post date:** [March 5, 2018, 2:38pm UTC](https://discuss.elastic.co/t/how-to-use-completion-suggester-and-edge-ngram-tokenizer-function-together/122534/1 "2018-03-05T14:38:48Z")

</div>

I am trying to get my autocomplete search the best as possible. So I started with the completion suggester functions where I can define some weights on my documents suggest fields. This allows me to give some pre ranking while indexing my documents.

For example:

```
Berlin -> weight = 10
Bern -> weight = 8

```

If I search for `Ber` I will get this two documents where `Berlin` is higher ranked. Thats fine for now.

But lets say I have another document like `Hotel Berlin Alexanderplatz`. If I search for `Ber` now the Hotel will not appear. So I splitted the words by space and created some suggestions. If I search again for `Ber` the hotel will be in the response. Good for now but a problem ahead. If I search for `Berlin Hotel` the hotel will not be in the response anymore, because there is no suggestion for `Berling Hotel`.

So I searched for a better solution and found out that `edge_ngram tokenizer` does what I need. It breaks down text into words. Which will make `Hotel Berlin Alexanderplatz` findable in all combinations. Thats nice but I miss my weights now. Becuase these are very important for the result.

So is there a solution to use the weight feature of `complete suggester` and the word break down of an `edge_ngram tokenizer` together?

---

<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 2, 2018, 2:38pm UTC](https://discuss.elastic.co/t/how-to-use-completion-suggester-and-edge-ngram-tokenizer-function-together/122534/2 "2018-04-02T14:38:55Z")

</div>

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