Skip to content

Instantly share code, notes, and snippets.

@umeshdangat
Last active May 15, 2018 04:43
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/2524b9418065b2dbeeaf41cebd72d0ff to your computer and use it in GitHub Desktop.
Save umeshdangat/2524b9418065b2dbeeaf41cebd72d0ff to your computer and use it in GitHub Desktop.
{
"name": "feature_one_lunch",
"params": [
"feature_one_lunch_query",
"feature_one_lunch_language",
"feature_one_lunch_clicks",
"feature_one_lunch_impressions"
],
"template_language": "mustache",
"template": {
"function_score": {
"script_score": {
"script": {
"lang": "native",
"source": "feature_extractor",
"params": {
"raw_feature": "feature_one_lunch",
"query": "{{feature_one_lunch_query}}",
"language": "{{feature_one_lunch_language}}",
"smoothing_clicks": "{{feature_one_lunch_clicks}}",
"smoothing_impressions": "{{feature_one_lunch_impressions}}"
}
}
}
}
{
"name": "feature_two_brunch",
"params": [
"feature_two_brunch_query",
"feature_two_brunch_language",
"feature_two_brunch_clicks",
"feature_two_brunch_impressions"
],
"template_language": "mustache",
"template": {
"function_score": {
"script_score": {
"script": {
"lang": "native",
"source": "feature_extractor",
"params": {
"raw_feature": "feature_two_brunch",
"query": "{{feature_two_brunch_query}}",
"language": "{{feature_two_brunch_language}}",
"smoothing_clicks": "{{feature_two_brunch_clicks}}",
"smoothing_impressions": "{{feature_two_brunch_impressions}}"
}
}
}
}
{
"query": {
"bool": {
"filter": {
"terms": {
"_id": ["123", "456"]
}}}
},
"rescore": {
"query": {
"rescore_query": {
"sltr": {
"model": "my_example_model",
"params": {
},
"active_features": {"feature_two_brunch": true}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment