# edgeNGram filter prefix scoring precedence

**URL:** <https://discuss.elastic.co/t/edgengram-filter-prefix-scoring-precedence/12983>\
**Category:** Elasticsearch\
**Created:** [July 29, 2013, 10:08am UTC](https://discuss.elastic.co/t/edgengram-filter-prefix-scoring-precedence/12983 "2013-07-29T10:08:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_L](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@John\_L](https://discuss.elastic.co/u/John_L)\
**Post date:** [July 29, 2013, 10:08am UTC](https://discuss.elastic.co/t/edgengram-filter-prefix-scoring-precedence/12983/1 "2013-07-29T10:08:55Z")

</div>

Hi

I am attempting to use the edgeNGram filter for autocomplete. This works,  
but I wish to do a _prefix_ based edgeNGram search so that fields beginning  
with a matching token appear first in the result set (in a manner similar  
to the phrase\_prefix query). For example:

Searching for: "_brow bea_"

should score the field containing: "_brown bear_" higher than the field  
that contains "_red brown bear_". In my configuration both of these  
searches end up with the same score.

I have tried executing this query with match\_phrase to no avail. If I use  
a "phrase\_prefix" query I get the correct result - but I understand this is  
a slower approach.

Any advice appreciated.  
Cheers,  
John

--  
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:24am UTC](https://discuss.elastic.co/t/edgengram-filter-prefix-scoring-precedence/12983/2 "2017-07-06T02:24:03Z")

</div>


