Hello All
Good Evening
i prepare custom_filter_score query script
sample query
{
"timeout" : 60000,
"query" : {
"custom_filters_score" : {
"query" : {
"bool" : {
"should" : {
"query_string" : {
"query" : "kids",
"default_operator" : "or"
}
},
"minimum_should_match" : "1"
}
},
"filters" : [ {
"filter" : {
"numeric_range" : {
"payload.calculate" : {
"from" : "1",
"to" : "4",
"include_lower" : false,
"include_upper" : false
}
}
},
"script" : "scoringFieldValueList =
scoringFieldValue.split(delimiter); int i = 0; float _cscore = _score;
while(i <
scoringFieldValueList.size()){if(_source.payload.name.contains(scoringFieldValueList[i])){
_cscore = _cscore + 1.5; } i++; } _score=_cscore;"
}, {
"filter" : {
"numeric_range" : {
"payload.calculate" : {
"from" : "1",
"to" : "3",
"include_lower" : false,
"include_upper" : false
}
}
},
"script" : "scoringFieldValueList =
scoringFieldValue.split(delimiter); int i = 0; float _cscore = _score;
while(i <
scoringFieldValueList.size()){if(_source.payload.name.contains(scoringFieldValueList[i])){
_cscore = _cscore + 1.5; } i++; } _score=_cscore;"
} ],
"score_mode" : "total",
"params" : {
"delimiter" : ",",
"scoringFieldValue" : "American baby oil,American bandaid"
}
}
},
"explain" : false,
"fields" : [ "payload.contractName", "payload.code",
"payload.thing_type", "payload.name", "payload.description",
"payload.storefrontid" ]
}
es side throws the error
Caused by: [Error: unresolvable property or identifier: _score]
[Near : {float _cscore = _score;}]
please help me
Regards
Shanmugam.M
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.