Function_score limt size

{
"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.

did you look into the rescorer and the windows_size parameter?

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.