Function_score limt size


(Amber New) #1

{
"query": {
"function_score" : {
"query": {
"match": {
"title":"elasticsearch"
}
},
"script_score": {
"script":{
"inline": "javapulgin",
"lang": "native",
}
}
},
"size": 10
}

the idea is we will use script plugin to rescore the search results returned from the first query. I am wondering is there a way we can limit the size for first query. for example.i can hit 2000 results by query"elasticsearch", but i want to fetch top 1000 order by score. and just rescore top1000 by script plugin.Please advise some feasible approach?
thanks.


(Simon Willnauer) #2

did you look into the rescorer and the windows_size parameter?