# How to and efficient way to combine standard tokenizer with autocomplete (type ahead) functionality

**URL:** https://discuss.elastic.co/t/how-to-and-efficient-way-to-combine-standard-tokenizer-with-autocomplete-type-ahead-functionality/12300
**Category:** Elasticsearch
**Created:** [June 6, 2013, 4:51pm UTC](https://discuss.elastic.co/t/how-to-and-efficient-way-to-combine-standard-tokenizer-with-autocomplete-type-ahead-functionality/12300 "2013-06-06T16:51:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dave\_O](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dave_o/32/69398_2.png) [@Dave\_O](https://discuss.elastic.co/u/Dave_O)
#### Post date: [June 6, 2013, 4:51pm UTC](https://discuss.elastic.co/t/how-to-and-efficient-way-to-combine-standard-tokenizer-with-autocomplete-type-ahead-functionality/12300/1 "2013-06-06T16:51:23Z")

</div>

Trying to use the autocomplete functionality which I have in place using  
the following mappings

analysis : filter : placename\_ngram : max\_gram=15, min\_gram = 2, type =  
edge\_ngram  
analyzer :index: filter : lowercase, placename\_ngram, tokenizer : keyword  
placename\_search : filter: lowercase: tokenizer keyword

This works great for type ahead but when I'm trying to find a value like  
"contains in" it doesn't return the record.

Such as  
If I'm doing a text query on "Lake".

I will only get

Lake...  
Lake Wood,

But will not get  
Smithtown Lake

I have the field setup as multi-field and can do wildcard to find the  
values but not sure if this is efficient.

I believe I can use NGRAM but that seems like alot of overhead considering  
I only need index terms by whitespace (or by word). Not every permetation.

Any thoughts?

When I change the tokenizer on both to "standard"....It will then find  
these records...but my autocomplete gets messed up and brings back  
Smithtown Lake when typing Lak..... (which in this case I don't want).

Thanks for your help

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2017, 2:32am UTC](https://discuss.elastic.co/t/how-to-and-efficient-way-to-combine-standard-tokenizer-with-autocomplete-type-ahead-functionality/12300/2 "2017-07-06T02:32:34Z")

</div>


