# Can we use boost (^) functionality and then sort on that in results from query string?

**URL:** <https://discuss.elastic.co/t/can-we-use-boost-functionality-and-then-sort-on-that-in-results-from-query-string/160904>\
**Category:** Elasticsearch\
**Created:** [December 14, 2018, 12:32pm UTC](https://discuss.elastic.co/t/can-we-use-boost-functionality-and-then-sort-on-that-in-results-from-query-string/160904 "2018-12-14T12:32:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanika](https://avatars.discourse-cdn.com/v4/letter/k/4bbf92/32.png) [@kanika](https://discuss.elastic.co/u/kanika)\
**Post date:** [December 14, 2018, 12:32pm UTC](https://discuss.elastic.co/t/can-we-use-boost-functionality-and-then-sort-on-that-in-results-from-query-string/160904/1 "2018-12-14T12:32:44Z")

</div>

I have a field- Firstname and Lastname in my index. I have a query where if i type "Ra", i am able to get the results which start with "Ra" first as shown below using the boost (^) in query string on the Firstname field.  
Ramanathan, Arumugam  
Rajesh, Arumugam  
Arumugam, Ranjith  
Arumugam, Ramesh

But I also need these records to be sorted (i.e. Rajesh should come before Ramanathan) after boost so that i should finally get the results in below order which i am not able to achieve. This is because the sort function is being given priority over boost.  
Rajesh, Arumugam  
Ramanathan, Arumugam  
Arumugam, Ramesh  
Arumugam, Ranjith

Can someone help on this ?

---

<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:** [January 11, 2019, 12:32pm UTC](https://discuss.elastic.co/t/can-we-use-boost-functionality-and-then-sort-on-that-in-results-from-query-string/160904/2 "2019-01-11T12:32:44Z")

</div>

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