Skip to content

Instantly share code, notes, and snippets.

@PierreCavalet
Last active July 3, 2019 07:06
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 PierreCavalet/f29738ebe34115d6567857b731c5c660 to your computer and use it in GitHub Desktop.
Save PierreCavalet/f29738ebe34115d6567857b731c5c660 to your computer and use it in GitHub Desktop.
curl -X GET "localhost:9200/useralgo/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"function_score": {
"query": {"match_all": {}},
"functions": [
{
"filter": {
"bool": {
"must_not": {
"ids": { "values": ["articleId2"] }
}
}
},
"weight": 8
},
{
"filter": { "terms": { "tags": ["people", "whatever"] } },
"weight": 4
},
{
"filter": { "term": { "important": true } },
"weight": 2
}
],
"score_mode": "sum"
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment