Skip to content

Instantly share code, notes, and snippets.

@rockbot
Created March 12, 2014 21:12
Show Gist options
  • Save rockbot/9516450 to your computer and use it in GitHub Desktop.
Save rockbot/9516450 to your computer and use it in GitHub Desktop.
{
"fields": [ "name", "keywords", "description", "author", "version",
"stars" ],
"query": {
"function_score": {
"query": {
"multi_match": {
"query": "underscore",
"fields": [ "name^4", "keywords", "description", "readme" ]
}
},
"script_score": {
"script": "_score + doc['stars'].value"
}
}
}
}
@Philmod
Copy link

Philmod commented Mar 12, 2014

Nice, thanks!

Why did you decide to add _score and not multiply it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment