I've figured it out, to add extras to a must
, must_not
or should
, they must be in an outer array like:
"query": {
"bool": {
"must": [
{
"terms": {
"facet_1": [
"1",
"2"
]
}
},
{
"function_score": {
"query": {
"multi_match": {
"query": "fat food",
"fields": [
"family_name^20",
"parent_categories^2",
"description^0.2",
"product_suffixes^8",
"facet_values^10"
],
"operator": "and",
"type": "best_fields",
"tie_breaker": 0.3
}
},
"functions": [
{
"script_score": {
"script": "_score + ((_score * 0.3) + (log(1 + doc[\"popularity_score\"].value) * 2))"
}
}
],
"score_mode": "sum"
}
}
]
}
},
"fields": [
"family_id",
"family_name",
"parent_categories",
"description",
"image",
"url",
"price_from",
"price_to",
"price_from_id",
"price_to_id",
"products_ids",
"popularity_score"
],
"from": 0,
"size": 48,
"sort": {
"_score": "desc"
}
}
Thanks for look anyway.