Skip to content

Instantly share code, notes, and snippets.

@greatwitenorth
Created June 12, 2013 18:33
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 greatwitenorth/e62034b990fbaba0863e to your computer and use it in GitHub Desktop.
Save greatwitenorth/e62034b990fbaba0863e to your computer and use it in GitHub Desktop.
curl -XGET 'http://localhost:9200/spna/post/11003/_explain?pretty=true' -d '
{
"size":10,
"from":0,
"sort":[
"_score"
],
"query": {
"custom_filters_score": {
"query":{
"query_string" : {
"fields" : ["post_title", "post_content", "post_author", "category"],
"query" : "link building"
}
},
"params": {
"now": 1370970933000
},
"filters": [
{
"filter": {
"exists": {
"field": "post_date"
}
},
"script": "(0.08 / ((3.16*pow(10,-11)) * abs(now - doc['post_date'].date.getMillis()) + 0.05)) + 1.0"
}
]
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment