Skip to content

Instantly share code, notes, and snippets.

@umeshdangat
Created September 1, 2018 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umeshdangat/da1948e693754dc3575750218195d0b6 to your computer and use it in GitHub Desktop.
Save umeshdangat/da1948e693754dc3575750218195d0b6 to your computer and use it in GitHub Desktop.
scriptfeature_diff_param_names_ltr_vs_es_script
"model": {
"name": "my_simple_linear_model_1",
"feature_set": {
"name": "simple_painless_features",
"features": [
{
"name": "feature1",
"params": [
"feature1_param"
],
"template_language": "mustache",
"template": {
"function_score": {
"script_score": {
"script": {
"lang": "painless",
"params": {
"feature1_param": "{{feature1_param}}"
},
"source": "{{feature1_param}}"
}
}
}
}
},
{
"name": "feature2",
"params": [
"multiplier_ltr"
],
"template_language": "script_feature",
"template": {
"lang": "painless",
"source": "params.feature_vector.get('feature1') * (long)params.multiplier",
"params": {
"multiplier": "multiplier_ltr"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment