# How to Boost the document with following conditions

**URL:** <https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031>\
**Category:** Elasticsearch\
**Created:** [December 27, 2013, 9:59am UTC](https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031 "2013-12-27T09:59:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsbonline2006](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jsbonline2006](https://discuss.elastic.co/u/jsbonline2006)\
**Post date:** [December 27, 2013, 9:59am UTC](https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031/1 "2013-12-27T09:59:32Z")

</div>

HI,

I want to boost the documents based on following conditions:  
So could you please help me out in the query syntax for each of the  
following.  
I am using ES 0.90.7

1. Higher boost if Search keyword appears at the start of title.  
Example: If I am searching for "Rum Cake"  
Then Title1 should get higher boosting than Title2

Title1: "Rum Cakes are always good in Taste"  
Title2: "I Love Rum Cakes"

* * *

1. Higher weightage to "frequently asked questions" word in the title and  
Higher weightage to "technical Specifications" word in the title

* * *

1. 

If the search keyword is the complete title itself than it has higher  
priority than the title which has the search keyword along with some of the  
other words  
Example: If I am searching for "Rum Cake"  
Then Title1 should get higher boosting than Title2

Title1: "Rum Cakes"  
Title2: "I Love Rum Cakes"

Please let me know if the above 3 rules can be configured in elasticsearch  
or not?  
If Yes, Could you please explain them in form of queries.

Regards,  
Jayesh Bhoyar

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0481d882-1fc8-4c84-9660-aee0f8f4007a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0481d882-1fc8-4c84-9660-aee0f8f4007a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jsbonline2006](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jsbonline2006](https://discuss.elastic.co/u/jsbonline2006)\
**Post date:** [December 30, 2013, 5:14am UTC](https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031/2 "2013-12-30T05:14:36Z")

</div>

Hi Team,

Any update on this query?

Regards,  
Jayesh Bhoyar

On Friday, December 27, 2013 3:29:32 PM UTC+5:30, Jayesh Bhoyar wrote:

> HI,
> 
> I want to boost the documents based on following conditions:  
> So could you please help me out in the query syntax for each of the  
> following.  
> I am using ES 0.90.7
> 
> 1. Higher boost if Search keyword appears at the start of title.  
> Example: If I am searching for "Rum Cake"  
> Then Title1 should get higher boosting than Title2
> 
> Title1: "Rum Cakes are always good in Taste"  
> Title2: "I Love Rum Cakes"
> 
> * * *
> 
> 1. Higher weightage to "frequently asked questions" word in the title and  
> Higher weightage to "technical Specifications" word in the title
> 
> * * *
> 
> 1. 
> 
> If the search keyword is the complete title itself than it has higher  
> priority than the title which has the search keyword along with some of the  
> other words  
> Example: If I am searching for "Rum Cake"  
> Then Title1 should get higher boosting than Title2
> 
> Title1: "Rum Cakes"  
> Title2: "I Love Rum Cakes"
> 
> Please let me know if the above 3 rules can be configured in elasticsearch  
> or not?  
> If Yes, Could you please explain them in form of queries.
> 
> Regards,  
> Jayesh Bhoyar

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/78296a01-c04e-4822-a346-5712f98cb9db%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/78296a01-c04e-4822-a346-5712f98cb9db%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [December 30, 2013, 8:23am UTC](https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031/3 "2013-12-30T08:23:39Z")

</div>

You can try playing with boost but in your case function score feature could be more appropriate.

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 déc. 2013 à 06:14, Jayesh Bhoyar [jsbonline2006@gmail.com](mailto:jsbonline2006@gmail.com) a écrit :

> Hi Team,
> 
> Any update on this query?
> 
> Regards,  
> Jayesh Bhoyar
> 
> On Friday, December 27, 2013 3:29:32 PM UTC+5:30, Jayesh Bhoyar wrote:
> 
> > HI,
> > 
> > I want to boost the documents based on following conditions:  
> > So could you please help me out in the query syntax for each of the following.  
> > I am using ES 0.90.7
> > 
> > 1. Higher boost if Search keyword appears at the start of title.  
> > Example: If I am searching for "Rum Cake"  
> > Then Title1 should get higher boosting than Title2
> > 
> > Title1: "Rum Cakes are always good in Taste"  
> > Title2: "I Love Rum Cakes"
> > 
> > * * *
> > 
> > 1. Higher weightage to "frequently asked questions" word in the title and  
> > Higher weightage to "technical Specifications" word in the title
> > 
> > * * *
> > 
> > 1. 
> > 
> > If the search keyword is the complete title itself than it has higher priority than the title which has the search keyword along with some of the other words  
> > Example: If I am searching for "Rum Cake"  
> > Then Title1 should get higher boosting than Title2
> > 
> > Title1: "Rum Cakes"  
> > Title2: "I Love Rum Cakes"
> > 
> > Please let me know if the above 3 rules can be configured in elasticsearch or not?  
> > If Yes, Could you please explain them in form of queries.
> > 
> > Regards,  
> > Jayesh Bhoyar
> 
> --  
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/78296a01-c04e-4822-a346-5712f98cb9db%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/78296a01-c04e-4822-a346-5712f98cb9db%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/B5C62F3C-ED2E-48A5-8B8F-14D20A407AED%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/B5C62F3C-ED2E-48A5-8B8F-14D20A407AED%40pilato.fr).  
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, 1:59am UTC](https://discuss.elastic.co/t/how-to-boost-the-document-with-following-conditions/15031/4 "2017-07-06T01:59:05Z")

</div>


