获取特定类别的所有嵌套字段

时间:2017-08-25 04:29:24

标签: elasticsearch

我的弹性搜索产品有以下格式和变化。如果我知道要搜索的参数,我可以进行各种搜索。但由于嵌套的子类别,某些产品的变化与其他产品不同。

{
                "_index": "ecommerce",
                "_type": "products",
                "_id": "12895",
                "_score": 1,
                "_source": {
                    "title": "Blue Armani Jeans",
                    "slug": "blue-armani-jeans",
                    "price": 200,
                    "sale_price": 0,
                    "vendor_id": 62,
                    "featured": 0,
                    "viewed": 0,
                    "stock": 1,
                    "sku": "arm-jeans",
                    "brand": "",
                    "rating": 0,
                    "active": 0,
                    "vendor_name": "Armani",
                    "category": [
                        "Men Fashion",
                        "Casual Wear"
                    ],
                    "image": "armani-jeans.jpg",
                    "variations": [
                        {
                            "variation_id": "32",
                            "stock": 10,
                            "price": 199,
                            "variation_image": "",
                            "sku": "arm-jeans-11",
                            "Size": "38",
                            "Color": "Blue"
                        },
{
                            "variation_id": "33",
                            "stock": 10,
                            "price": 199,
                            "variation_image": "",
                            "sku": "arm-jeans-12",
                            "Size": "40",
                            "Color": "Blue"
                        }
                    ]
                }
            },

这只是一种产品,我有数百种具有不同变化参数的类似产品。是否有可能从某个类别中获取所有变量参数的列表?

必需: 获取男士休闲装的所有变化参数即。颜色,尺寸,价格,腰围等

0 个答案:

没有答案