# Absolute scoring of fields

**URL:** https://discuss.elastic.co/t/absolute-scoring-of-fields/19194
**Category:** Elasticsearch
**Created:** [August 11, 2014, 12:55pm UTC](https://discuss.elastic.co/t/absolute-scoring-of-fields/19194 "2014-08-11T12:55:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bernhardt\_Scherer](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Bernhardt\_Scherer](https://discuss.elastic.co/u/Bernhardt_Scherer)
#### Post date: [August 11, 2014, 12:55pm UTC](https://discuss.elastic.co/t/absolute-scoring-of-fields/19194/1 "2014-08-11T12:55:15Z")

</div>

Hey there!

I have some trouble with building a query in elasticsearch..

My requirements are:

Documents have 4 fields:  
Field\_A  
Field\_B  
Field\_C  
Field\_D

I would like to build an absolut scoring, that DOESN'T take the  
elasticsearch scoring into account.

If the search query matches one field, then it should always get the same  
specific score, e.g.:

Match in Field\_A = 4.0  
Match in Field\_B = 3.0  
Match in Field\_C = 2.0  
Match in Field\_D = 1.0

How would a search query be built to meet those requirements? I have tried  
building it with function score but unfortunately I couldn't get very far  
with the poor documentation for that query...

Many thanks in advance!

Best,  
Bernhardt

--  
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/5b420be6-aa85-4b28-bfe2-4b8fcfa6055d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5b420be6-aa85-4b28-bfe2-4b8fcfa6055d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [August 11, 2014, 10:14pm UTC](https://discuss.elastic.co/t/absolute-scoring-of-fields/19194/2 "2014-08-11T22:14:24Z")

</div>

You can wrap each individual match query in a constant score query and place them as clauses in a boolean query.

The guide has an example:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

Bernhardt Scherer [bernhardt.scherer@project-a.com](mailto:bernhardt.scherer@project-a.com) wrote:

> Heythere!Ihavesometroublewithbuildingaqueryinelasticsearch..Myrequirementsare:Documentshave4fields:Field\_AField\_BField\_CField\_DIwouldliketobuildanabsolutscoring,thatDOESN'Ttaketheelasticsearchscoringintoaccount.Ifthesearchquerymatchesonefield,thenitshouldalwaysgetthesamespecificscore,e.g.:MatchinField\_A=4.0MatchinField\_B=3.0MatchinField\_C=2.0MatchinField\_D=1.0Howwouldasearchquerybebuilttomeetthoserequirements?IhavetriedbuildingitwithfunctionscorebutunfortunatelyIcouldn'tgetveryfarwiththepoordocumentationforthatquery...Manythanksinadvance!Best,Bernhardt--YoureceivedthismessagebecauseyouaresubscribedtotheGoogleGroupselasticsearchgroup.Tounsubscribefromthisgroupandstopreceivingemailsfromit,sendanemailtoelasticsearch+unsubscribe@googlegroups.com.Toviewthisdiscussiononthewebvisithttps://groups.google.com/d/msgid/elasticsearch/5b420be6-aa85-4b28-bfe2-4b8fcfa6055d%40googlegroups.com.Formoreoptions,visithttps://groups.google.com/d/optout.

--  
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/p9r6ltxythoay4klou2hyvvy.1407795264036%40email.android.com](https://groups.google.com/d/msgid/elasticsearch/p9r6ltxythoay4klou2hyvvy.1407795264036%40email.android.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:09am UTC](https://discuss.elastic.co/t/absolute-scoring-of-fields/19194/3 "2017-07-06T01:09:26Z")

</div>


