A slow query problem in elasticsearch (aggregation)

Please help me optimize this query. The index is 800mb and the query time is about to exceed 1 second.

{
    "from": 0,
    "size": 300,
    "explain": "true",
    "_source": [
        "sku_id",
        "upc",
        "spu_id",
        "title",
        "primary_desc",
        "brand",
        "upc_desc",
        "dept_desc",
        "category_desc",
        "fineline_desc",
        "effective_date",
        "dept_nbr",
        "category_nbr",
        "fineline_nbr",
        "category_stream",
        "manual_words",
        "forbidden_words",
        "sales_num",
        "category_front_id",
        "brand_name",
        "item_type",
        "brand_id",
        "category_front_name"
    ],
    "query": {
        "bool": {
            "must": [
                {
                    "multi_match": {
                        "query": "milk",
                        "fields": [
                            "title^10",
                            "primary_desc^10",
                            "brand^10",
                            "manual_words^50",
                            "upc_desc^5",
                            "short_text^5",
                            "selling_points",
                            "dept_desc^5",
                            "category_desc^5",
                            "fineline_desc^5",
                            "category_back_name^5",
                            "category_front_name^5",
                            "brand_name^10",
                            "click_stream^3",
                            "click_stream.break_both^3",
                            "session_stream",
                            "session_stream.break_both",
                            "category_stream^20",
                            "category_query_stream"
                        ],
                        "type": "cross_fields",
                        "minimum_should_match": "60%"                    }
                },
                {
                    "term": {
                        "data_type": 2
                    }
                },
                {
                    "has_child": {
                        "type": "store",
                        "query": {
                            "bool": {
                                "must": [
                                    {
                                        "terms": {
                                            "store_id": [
                                                "1059",
                                                "9635",
                                                "5148"
                                            ]
                                        }
                                    },
                                    {
                                        "term": {
                                            "is_valid": 1
                                        }
                                    },
                                    {
                                        "term": {
                                            "data_type": 2
                                        }
                                    }
                                ]
                            }
                        },
                        "inner_hits": {
                            "_source": [
                                "store_id",
                                "price",
                                "delivery_attr",
                                "reseller"
                            ]
                        }
                    }
                }
            ]
        }
    }
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.