Hello, I would like to query on a script field.
I'm trying this query without success :
{
"query": {
"multi_match": {
"query": "machinbidule",
"fields": [
"name^9",
"concatenated_synonyms^8",
"x_long_description^7",
"code_prefix^6",
"x_colors^5"
],
"type": "best_fields",
"tie_breaker": 0.3,
"fuzziness": 2
}
},
"script_fields": {
"concatenated_synonyms": {
"script": {
"lang": "painless",
"source": "String.join(',', params._source.x_synonyms.stream().map(s -> s.name).collect(Collectors.toList()))"
}
}
}
}
Could you help me to fix this query ?
Thank you,
best regards,
Nicolas