# Exact string match

**URL:** <https://discuss.elastic.co/t/exact-string-match/124110>\
**Category:** Elasticsearch\
**Created:** [March 15, 2018, 2:03pm UTC](https://discuss.elastic.co/t/exact-string-match/124110 "2018-03-15T14:03:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vicarious](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@Vicarious](https://discuss.elastic.co/u/Vicarious)\
**Post date:** [March 15, 2018, 2:03pm UTC](https://discuss.elastic.co/t/exact-string-match/124110/1 "2018-03-15T14:03:20Z")

</div>

Hello,

I'm new to elastic search but I'm trying to best. I've been trying to solve an issue lately but without success.  
I'm trying to boost results that have exact match of the search term. Let me explain.

Simple scenario:

Let say I have 2 items. Each has a name that is being searched.  
1 - "name":"A lot of pain",  
2 - "name" : "Not very painful"

Lets say I search with term "pain"  
Currently the field "name" is analyzed by custom analyzer that is returning both items.

What I want to achieve is to boost item 1 as it contains exact match of the search term.  
While I still want item 2 to be return as its still contains the search term but to be on lower score as its not exact match.

Hope it makes sense,  
best regards

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 15, 2018, 2:15pm UTC](https://discuss.elastic.co/t/exact-string-match/124110/2 "2018-03-15T14:15:22Z")

</div>

You can find some ideas here:

> <https://gist.github.com/dadoonet/5179ee72ecbf08f12f53d4bda1b76bab>

---

<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:** [April 12, 2018, 2:15pm UTC](https://discuss.elastic.co/t/exact-string-match/124110/3 "2018-04-12T14:15:49Z")

</div>

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