# How to improve the search relevance in elasticsearch?

**URL:** https://discuss.elastic.co/t/how-to-improve-the-search-relevance-in-elasticsearch/50628
**Category:** Elasticsearch
**Created:** [May 21, 2016, 5:33pm UTC](https://discuss.elastic.co/t/how-to-improve-the-search-relevance-in-elasticsearch/50628 "2016-05-21T17:33:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lijoabraham](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lijoabraham](https://discuss.elastic.co/u/lijoabraham)
#### Post date: [May 21, 2016, 5:33pm UTC](https://discuss.elastic.co/t/how-to-improve-the-search-relevance-in-elasticsearch/50628/1 "2016-05-21T17:33:25Z")

</div>

I am having a field named title which is having values as below

1. apple iphone 6s
2. apple iphone 6
3. apple iphone 6s plus
4. apple iphone
5. apple iphone 5s

So if user searches for

> apple iphone 6  
> Then it should come in the order as

> 2 \> 1 \> 3 \> 4 \> 5  
> . and if user searches for

> apple iphone 6s  
> It should come in order as

> 1 \> 3 \> 2 \> 4 \> 5.  
> How can this be done using elasticsearch.

I have used multi\_search and all. But no help.

The order should be exact match first, then prefix. then phrases then field containing all 3 terms and then field containing 2 terms and then field containing 1 terms and so on.

Thank you for your help.

---

<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 5, 2017, 10:49pm UTC](https://discuss.elastic.co/t/how-to-improve-the-search-relevance-in-elasticsearch/50628/2 "2017-07-05T22:49:59Z")

</div>


