Skip to content

Instantly share code, notes, and snippets.

@alexmorozov
Created April 3, 2015 06:41
Show Gist options
  • Save alexmorozov/b4aa8aabc8df69731aab to your computer and use it in GitHub Desktop.
Save alexmorozov/b4aa8aabc8df69731aab to your computer and use it in GitHub Desktop.
example ES score script
"script_score":{
"params":{
"normalizer":15
},
"script":"_score+((doc.containsKey(\"hotel.eating_place.rating\") && !doc[\"hotel.eating_place.rating\"].empty ? doc[\"hotel.eating_place.rating\"].value : 0.0)+(doc.containsKey(\"hotel.basin.rating\") && !doc[\"hotel.basin.rating\"].empty ? doc[\"hotel.basin.rating\"].value : 0.0)+(doc.containsKey(\"hotel.room.rating\") && !doc[\"hotel.room.rating\"].empty ? doc[\"hotel.room.rating\"].value : 0.0))/normalizer"
},
"boost_mode":"replace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment