FilterFunctionBuilder Java Api

Hi,

I want to create FilterFunctionBuilder[ ] in order to create more than one ScoreFunctionBuilders, but when I try it in my project the only recognizable constructor is FunctionScoreQueryBuilder.FilterFunctionBuilder.

I want to create something like this using elasticsearch 6.0 java api:

{
"query" : {
"function_score" : {
"query" : {
"bool" : {
"must" : [
----boolFilter----
],
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
"functions" : [
{
"filter" : {
"match_all" : {
"boost" : 1.0
}
},
"script_score" : {
"script" : {
"source" : "_score * (doc['field'].value!=0 ? 50000:1)",
"lang" : "painless"
}
}
},
{
"filter" : {
"match_all" : {
"boost" : 1.0
}
},
"script_score" : {
"script" : {
"source" : "_score * (doc['field2'].value!=null ? 40000:1)",
"lang" : "painless"
}
}
}
],
}
}
}

Thank you in advance!

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