Absolute scoring of fields


(Bernhardt Scherer) #1

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5b420be6-aa85-4b28-bfe2-4b8fcfa6055d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #2

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:

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/ignoring-tfidf.html#constant-score-query

Cheers,

Ivan

Bernhardt Scherer 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/p9r6ltxythoay4klou2hyvvy.1407795264036%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3