# Ngram and Huspell analyzers in common index

**URL:** <https://discuss.elastic.co/t/ngram-and-huspell-analyzers-in-common-index/156051>\
**Category:** Elasticsearch\
**Created:** [November 9, 2018, 12:48pm UTC](https://discuss.elastic.co/t/ngram-and-huspell-analyzers-in-common-index/156051 "2018-11-09T12:48:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuri\_Shekhovtsov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuri_shekhovtsov/32/37467_2.png) [@Yuri\_Shekhovtsov](https://discuss.elastic.co/u/Yuri_Shekhovtsov)\
**Post date:** [November 9, 2018, 12:48pm UTC](https://discuss.elastic.co/t/ngram-and-huspell-analyzers-in-common-index/156051/1 "2018-11-09T12:48:00Z")

</div>

I want to combine full text search with autocomplete in a search field. I use a hunspell token filter in the main analyzer for searching. But I want to add ngram in addition.

When I type queries in a search field letter by letter I can see results from time to time (only in those cases when my tokenized query matched at least with one stem) otherwise results will be empty (in a moment when word has been written partly for example). In shuch situations I want to add ngram working results in order to avoid emptiness.

Should I do 2 indexes for this reason. In the first index I will keep data which have been stored by hunspell tokenizer. In the second with Ngram. This separation helps to avoid mixing saved tokens (stems) of both analyzers(tokenizers). As consequence I have to send second request in case when the first response (to 1 index) is empty.

If I keep all data in one index which processed by both analyzers a tokens intersection of different analyzers will interfere in relevance scoring.

Is there elegant way to solve this problem using only one index??

---

<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:** [December 7, 2018, 12:48pm UTC](https://discuss.elastic.co/t/ngram-and-huspell-analyzers-in-common-index/156051/2 "2018-12-07T12:48:02Z")

</div>

Closed on December 7, 2018, 12:48pm UTC

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