Skip to content

Instantly share code, notes, and snippets.

@emedina
Created April 11, 2011 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save emedina/913246 to your computer and use it in GitHub Desktop.
Save emedina/913246 to your computer and use it in GitHub Desktop.
MVEL for script in custom_score_query
{
"from": 0,
"size": 28,
"query": {
"custom_score": {
"query": {
"query_string": {
"query": "iphone"
}
},
"script": {
"script": "if (doc['categorias2'].stringValue == 'Libros') { _score / 2 } else { _score }"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment