我的索引中有产品。文档的结构基本上是这样的:
{
"_id": "product",
"_source": {
...
"type": "product",
"id": 1,
"mainTaxon": {
"name": "T-SHIRT",
},
"attributes": [
{
"code": "name",
"name": "Name",
"value": [
"BANANA T-SHIRT"
],
"score": 50
},
]
}
},
{
"_id": "product",
"_source": {
...
"type": "product",
"id": 2,
"mainTaxon": {
"name": "JEANS",
},
"attributes": [
{
"code": "name",
"name": "Name",
"value": [
"BANANA JEANS"
],
"score": 50
},
]
}
}
}
当我搜索“ BANANA
”时,我会优先考虑与mainTaxon
不同的产品JEANS
。因此,带有mainTaxon
名称T_SHIRT
或其他名称的每个产品都将列在带有mainTaxon
JEANS
.