I am trying to run a straight forward Function Score Query in elasticsearch as:
{
"function_score": {
"query": {
"term": {
"timestamp": {
"value": 1396361509,
"boost": 0.05
}
}
},
"script_score": {
"script": "abs(1396361509 - doc['timestamp'].value)"
}
}
}
but I keep getting an error saying that there is no parser for "function_score":
SearchParseException[[test_index][4]: from[-1],size[-1]: Parse Failure [No parser for element [function_score]]]; }{[PKoYz4OLTbOWb6ziP8AIaQ][test_index][1]: SearchParseException[[test_index][1]: from[-1],size[-1]: Parse Failure [Failed to parse source
I am using elasticsearch 1.1.1 and tried running it via curl call, from elastic-head, and via a JAVA API. Results are always the same!