我即将在Eleasticsearch中存储产品目录的数据,其简化模型如下所示: Product catalog model
我可以将整个产品存储为一个文档:
{
"productNumber": "123456",
"brand": "Acme Inc.",
"title": "T-Shirt",
"featured": false,
"promo": true,
"categories": [
{ "categoryId": "124", "categoryPath": "/10/123/124", "title": "T-Shirts", "titlePath": "Men's/Summer/T-Shirts" },
{ "categoryId": "666", "categoryPath": "/20/666", "title": "Men's", "titlePath": "Promos / Men's" }
],
"variants": [
{
"sku": "123456-01",
"color": "red",
"size": "XL",
"prices": [
{ "pricelist": "EUR-RRP", "currency": "EUR", "price": 200, "discountPc": 0, "discounted": false },
{ "pricelist": "EUR-PROMO", "currency": "EUR", "price": 180, "discountPc": 10, "discounted": true }
],
"inventories": [
{ "inventoryId": "INV-001", "stockCount": 0 },
{ "inventoryId": "INV-002", "stockCount": 5 }
]
}
]
}
我的问题是,如果我对搜索目录有这些要求,这是否是最好的方法,或者我应该将它拆分为多个关系索引:
每个搜索请求都预先配置了搜索参数,如下所示:
搜索用户定义的参数:
请注意,目录将是多语言的,因此我们的想法是为每种语言创建索引(例如,catalog-en,catalog-de等)