Rollup action in ISM

Reading the documentation for index rollups is see that:

You can use index rollup in three ways:

3. Specify the index rollup job as an ISM action for complete index management. This allows you to roll up an index after a certain event such as a rollover, index age reaching a certain point, index becoming read-only, and so on. You can also have rollover and index rollup jobs running in sequence, where the rollover first moves the current index to a warm node and then the index rollup job creates a new index with the minimized data on the hot node.

However when looking at the actions available for ISM, I see no mention of rollups at all.

Am I misunderstanding the documentation? Is it possible to perform rollups during an ISM state transition? If so, how do you specify the job as an action?

2 Likes

Hi Mark,

It looks like documentation is not updated, will attempt to update soon.

The feature is released and available since 1.13.0 I believe. Here is a sample ISM policy to create the rollup.
PS: At the moment only single run rollup jobs can be created through this path, the source index for the rollup job is inferred from the index the policy is attached to.

{
    "policy": {
        "description": "Sample rollup" ,
        "default_state": "rollup",
        "states": [
            {
                "name": "rollup",
                "actions": [
                    {
                        "rollup": {
                            "ism_rollup": {
                                "description": "Creating rollup through ISM",
                                "target_index": "target",
                                "page_size": 1000,
                                "dimensions": [
                                    {
                                        "date_histogram": {
                                            "fixed_interval": "60m",
                                            "source_field": "order_date",
                                            "target_field": "order_date",
                                            "timezone": "America/Los_Angeles"
                                        }
                                    },
                                    {
                                        "terms": {
                                            "source_field": "customer_gender",
                                            "target_field": "customer_gender"
                                        }
                                    },
                                    {
                                        "terms": {
                                            "source_field": "day_of_week",
                                            "target_field": "day_of_week"
                                        }
                                    }
                                ],
                                "metrics": [
                                    {
                                        "source_field": "taxless_total_price",
                                        "metrics": [
                                            {
                                                "sum": {}
                                            }
                                        ]
                                    },
                                    {
                                        "source_field": "total_quantity",
                                        "metrics": [
                                            {
                                                "avg": {}
                                            },
                                            {
                                                "max": {}
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                ],
                "transitions": []
            }
        ]
    }
}
5 Likes

Thank you! That’s very helpful and got me pointed in the right direction.

One note for posterity – you are missing a closing quote here:

Is there a github issue tracking when the docs will be updated with this example?