# Boosting results with Custom Filter Score and filter boost problem

**URL:** https://discuss.elastic.co/t/boosting-results-with-custom-filter-score-and-filter-boost-problem/12762
**Category:** Elasticsearch
**Created:** [July 12, 2013, 6:14am UTC](https://discuss.elastic.co/t/boosting-results-with-custom-filter-score-and-filter-boost-problem/12762 "2013-07-12T06:14:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Skeez](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Skeez](https://discuss.elastic.co/u/Skeez)
#### Post date: [July 12, 2013, 6:14am UTC](https://discuss.elastic.co/t/boosting-results-with-custom-filter-score-and-filter-boost-problem/12762/1 "2013-07-12T06:14:52Z")

</div>

Hi,

We are trying to use Elastic Search to replace FAST.

We currently use FAST XRanks to apply relevancy to out search results and  
am trying to switch it to Elastic. I am not sure what the problem is but  
when using Custom Filter Score with Boosts on the Filters and a Score Mode  
of "total" we are getting very different results with the equivalent  
Elastic query / Boost values. Can anyone help out?

Maybe my understanding of the score mode "total" is not correct but I  
thought it would get the search results based on the query, apply the  
filters on each result item and sum up all boosts on the matching filters  
and then order descending on the score is that correct?

Below is the query we are using. The problem seems to be with the float  
range filters (priceToAveragePriceRatio, kmsToAverageKmsRatio) since the  
results do not seem to get boosted correctly on these on these (but I could  
be wrong).

{  
"from": 0,  
"size": 10,  
"sort": {  
"\_score": {  
"order": "desc"  
}  
},  
"query": {  
"custom\_filters\_score": {  
"query": {  
"bool": {  
"should": [  
{  
"match": {  
"usedNature": {  
"type": "phrase",  
"query": "Ex Demo Cars"  
}  
}  
},  
{  
"match": {  
"usedNature": {  
"type": "phrase",  
"query": "New Cars In Stock"  
}  
}  
},  
{  
"match": {  
"usedNature": {  
"type": "phrase",  
"query": "New Cars"  
}  
}  
},  
{  
"match": {  
"usedNature": {  
"type": "phrase",  
"query": "Used Cars"  
}  
}  
}  
]  
}  
},  
"filters": [  
{  
"filter": {  
"range": {  
"carInformation.priceToAveragePriceRatio": {  
"from": 0.7,  
"to": 1.01  
}  
}  
},  
"boost": 500  
},  
{  
"filter": {  
"range": {  
"carInformation.kmsToAverageKmsRatio": {  
"from": 0.7,  
"to": 1.1  
}  
}  
},  
"boost": 500  
},  
{  
"filter": {  
"range": {  
"publishedDateTime": {  
"from": "2013-06-30T23:22:16"  
}  
}  
},  
"boost": 700  
},  
{  
"filter": {  
"term": {  
"enhancedListing": "1"  
}  
},  
"boost": 9999  
},  
{  
"filter": {  
"range": {  
"imageCount": {  
"from": 8  
}  
}  
},  
"boost": 800  
},  
{  
"filter": {  
"range": {  
"carInformation.nvicCount": {  
"from": 1,  
"to": 1  
}  
}  
},  
"boost": 600  
},  
{  
"filter": {  
"range": {  
"imageCount": {  
"from": 4,  
"to": 7  
}  
}  
},  
"boost": 500  
},  
{  
"filter": {  
"term": {  
"carInformation.hasOdometer": "1"  
}  
},  
"boost": 100  
},  
{  
"filter": {  
"term": {  
"carInformation.hasColour": "1"  
}  
},  
"boost": 100  
},  
{  
"filter": {  
"term": {  
"price.isPoaPrice": "0"  
}  
},  
"boost": 200  
},  
{  
"filter": {  
"range": {  
"imageCount": {  
"from": 3,  
"to": 5  
}  
}  
},  
"boost": 300  
},  
{  
"filter": {  
"range": {  
"descriptionLength": {  
"from": 100  
}  
}  
},  
"boost": 150  
},  
{  
"filter": {  
"range": {  
"featureLength": {  
"from": 100  
}  
}  
},  
"boost": 150  
},  
{  
"filter": {  
"term": {  
"sourceSiteId": "3"  
}  
},  
"boost": 2000  
},  
{  
"filter": {  
"term": {  
"sourceSiteId": "1"  
}  
},  
"boost": 5000  
},  
{  
"filter": {  
"prefix": {  
"usedNature": "New Cars"  
}  
},  
"boost": 1000  
}  
],  
"score\_mode": "total"  
}  
}  
}

--  
The information contained in this e-mail message and any accompanying files  
is or may be confidential. If you are not the intended recipient, any use,  
dissemination, reliance, forwarding, printing or copying of this e-mail or  
any attached files is unauthorised. This e-mail is subject to copyright. No  
part of it should be reproduced, adapted or communicated without the  
written consent of the copyright owner. If you have received this e-mail in  
error please advise the sender immediately by return e-mail or telephone  
and delete all copies. Fairfax Media does not guarantee the accuracy or  
completeness of any information contained in this e-mail or attached files.  
Internet communications are not secure, therefore Fairfax Media does not  
accept legal responsibility for the contents of this message or attached  
files.

--  
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).  
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, 2:26am UTC](https://discuss.elastic.co/t/boosting-results-with-custom-filter-score-and-filter-boost-problem/12762/2 "2017-07-06T02:26:52Z")

</div>


