-
-
Save greatwitenorth/144507f760bbe3a311a6 to your computer and use it in GitHub Desktop.
trying to give my posts a date boost.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET 'http://localhost:9200/spna/post/_search?pretty=true' -d ' | |
{ | |
"size":10, | |
"from":0, | |
"sort":[ | |
"_score" | |
], | |
"query": { | |
"custom_filters_score": { | |
"query": "link building", | |
"params": { | |
"now": 1370970933000 | |
}, | |
"filters": [ | |
{ | |
"filter": { | |
"exists": { | |
"field": "post_date" | |
} | |
}, | |
"script": "(0.08 / ((3.16*pow(10,-11)) * abs(now - doc['date'].date.getMillis()) + 0.05)) + 1.0" | |
} | |
] | |
} | |
}, | |
"query":{ | |
"filtered":{ | |
"query" : { | |
"query_string" : { | |
"fields" : ["post_title", "post_date", "post_content", "post_author", "category"], | |
"query" : "link building" | |
} | |
} | |
} | |
}, | |
"highlight" : { | |
"fields" : { | |
"post_content" : {} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment