Hi all,
I'm running a query that looks like the following, only with many Filters:
{
"size": 30,
"query": {
"function_score": {
"query": {
"filtered": {
"query": {
"match_all": {}
}
}
},
"script_score": {
"script": "( doc['num'].value <= 3 || Math.random() < 1/doc['num'].value ) ? Math.random() : 0"
},
"boost_mode": "replace"
}
}
}
and am seeing run times about 10 times slower than without a Function Score Script, even when using all possible filters.
We are running Elastic version 1.0.0 and using Java API (package org.elasticsearch.client)
Is there any way to achieve a similar result with better performance? The links for "Native Java Scripts" in the tutorial seems broken