# Starts With search on a Field

**URL:** https://discuss.elastic.co/t/starts-with-search-on-a-field/21923
**Category:** Elasticsearch
**Created:** [January 30, 2015, 4:17pm UTC](https://discuss.elastic.co/t/starts-with-search-on-a-field/21923 "2015-01-30T16:17:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Shawn\_Mullen](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@Shawn\_Mullen](https://discuss.elastic.co/u/Shawn_Mullen)
#### Post date: [January 30, 2015, 4:17pm UTC](https://discuss.elastic.co/t/starts-with-search-on-a-field/21923/1 "2015-01-30T16:17:29Z")

</div>

I need to do a startswith search on data in a field. None of the  
"solutions" I've seen actually do this.

For example, if a have a field called "title" and it has "Tigers are  
awesome", and I search for titles that start with "Tiger" I get a hit.  
That's great. But I don't want a hit on the document with title "Awesome  
Tigers".

I know you can do this with "match\_phrase\_prefix". But the problem is  
"max\_expansions". If I have 8000 documents and they all start with  
"Tigers", the entire set of documents is not looked at since there is no  
apparent way to force a match\_phrase\_prefix to look at all documents.

I have tried edge\_ngrams solutions, but no luck. I still end up with  
documents that have the word "tigers", but don't start with the word  
"tigers".

So, is there a way to do a starts with search on a field, such that all  
documents in the index are looked at?

--  
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/92f61418-5756-4f83-b4e9-9c3a4f0fe503%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/92f61418-5756-4f83-b4e9-9c3a4f0fe503%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, 12:35am UTC](https://discuss.elastic.co/t/starts-with-search-on-a-field/21923/2 "2017-07-06T00:35:37Z")

</div>


