# Edge-NGram Ranking Results Incorrectly?

**URL:** <https://discuss.elastic.co/t/edge-ngram-ranking-results-incorrectly/196755>\
**Category:** Elasticsearch\
**Created:** [August 26, 2019, 11:44am UTC](https://discuss.elastic.co/t/edge-ngram-ranking-results-incorrectly/196755 "2019-08-26T11:44:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [August 26, 2019, 11:44am UTC](https://discuss.elastic.co/t/edge-ngram-ranking-results-incorrectly/196755/1 "2019-08-26T11:44:40Z")

</div>

I noticed the edge\_ngram analyzer scoring exact matches of a query lower than poor matches so I copied the data into a second field with the standard analyzer to compare.

I now have 2 fields with the same content but different analyzers:

- `text_xx`: standard analyzer
- `text_en`: edge\_ngram analyzer (3 to 20 chars)

Searching on the `edge_ngram` field yields the wrong rank/score IMHO.

I have a document which has text\_en/text\_xx="UVV 00031 099 Filterschlauch" and when I search for "UVV 00031 099" I expect this document to appear first. There are 50K+ documents containing "UVV".

1. Searching `(UVV 00031 099)` I get the result I want in second position:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/0/70771b437c9f05cc7c42c1174730cb9f5068c117.png)

2. Searching `text_en: (UVV 00031 099)` I don't even get the document at all:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/6/06ac2164e2a645c7379c9ef08791e35f419153f6.png)

3. Searching `text_xx: (UVV 00031 099)` I get the correct document in first place:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/c/fca7f85bb65021a74175e31656591accc87f3673.png)

Why does the Edge-NGram analyzer not score the exact match highest?

See the explanation of the search [here](https://gist.github.com/cawoodm/d2139ee00c8d31d392ef58e8eb08639d).

---

<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:** [September 23, 2019, 11:44am UTC](https://discuss.elastic.co/t/edge-ngram-ranking-results-incorrectly/196755/2 "2019-09-23T11:44:45Z")

</div>

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