更新时间:2023-02-08 20:19:55
尝试一下:
{
"query": {
"bool": {
"must": [
{
"match": {
"Main_ingredient.type": "Beef"
}
},
{
"range": {
"Main_ingredient.weight": {
"lte": 1000
}
}
},
{
"nested": {
"path": "Ingredients",
"query": {
"bool": {
"must": [
{
"match": {
"Ingredients.name": "garlic"
}
},
{
"range": {
"Ingredients.weight": {
"lte": 400
}
}
}
]
}
}
}
},
{
"nested": {
"path": "Ingredients",
"query": {
"bool": {
"must": [
{
"match": {
"Ingredients.name": "chilli powder"
}
},
{
"range": {
"Ingredients.weight": {
"lte": 400
}
}
}
]
}
}
}
}
]
}
}
}