# Realizing a prefix search across multiple tokens splitted by whitespace

**URL:** <https://discuss.elastic.co/t/realizing-a-prefix-search-across-multiple-tokens-splitted-by-whitespace/17426>\
**Category:** Elasticsearch\
**Created:** [May 9, 2014, 9:48am UTC](https://discuss.elastic.co/t/realizing-a-prefix-search-across-multiple-tokens-splitted-by-whitespace/17426 "2014-05-09T09:48:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Kluth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_kluth/32/1581_2.png) [@Alexander\_Kluth](https://discuss.elastic.co/u/Alexander_Kluth)\
**Post date:** [May 9, 2014, 9:48am UTC](https://discuss.elastic.co/t/realizing-a-prefix-search-across-multiple-tokens-splitted-by-whitespace/17426/1 "2014-05-09T09:48:25Z")

</div>

Although this is a topic which is discussed a lot on the internet I'm stuck  
with accomplishing one thing and I tried a lot unto this point.

I want to have a prefix search on multiple tokens in a string (splitted by  
whitespaces).

So, I've got the field Name with the content "Hamburg Altona" - now I want  
to search for "Ham Alt" and get all documents where the Name field contains  
a string starting with "Ham" _and_ a string starting with "Alt".

I tried several analyzing and tokenizing settings (nGram, edgeNGram,  
lowercase, standard etc. pp.) and several queries (phrase\_prefix, prefix),  
but I'm not able to get the wanted behavior as described above.

If further information is required just ask.

I really appreciate any pointers.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7b09a4f3-06dc-4c25-af18-db0ca0cb9a72%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7b09a4f3-06dc-4c25-af18-db0ca0cb9a72%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:30am UTC](https://discuss.elastic.co/t/realizing-a-prefix-search-across-multiple-tokens-splitted-by-whitespace/17426/2 "2017-07-06T01:30:34Z")

</div>

Closed on July 6, 2017, 1:30am UTC


