App search document ttl

Running 8.2 ECK and want to use 'app search' to make things searchable on our site. (using Kibana to configure)

How should I handle TTL (time-to-live) to only search for relevant data?

what I want

To configure app search to have a TTL on its documents.
Not updated for x time, delete it.

Example

We create a service that will poll a system for its data and PUT it to the api to create searchable documents.

POST /api/as/v1/engines/mysearchablestuff/documents
[
    {
        "id": "23857a02-334f-dc11-b781-005056a666aa",
        "customer_number": "123",
        "name": "Happy thing 1",
        "active": true,
        "account_type": "Association"
    },
    {
        "id": "1b857a02-334f-dc11-b781-005056a666aa",
        "customer_number": "46",
        "name": "Happy thing 2",
        "active": true,
        "account_type": "Association"
    }
]

After a while one of these might be active=false and then it will stop be exported. This because it's deleted from source system.

How can I say that if a document isn't updated in 5 days it should be deleted as a search document?

I've tried "Index Lifecycle Management" but I might configured it badly. What happened was it deleted the whole indices and then the search was broken.

Are you crawling the data using the Enterprise Search web crawler? There's a natural purge of documents that occurs with documents, and you can control the fresh ingestion of crawled data using things like partial crawls, to allow you to get data that is more frequently updated.