Cant understand example from documentation

Hi all.
I am studying Elasticsearch and I really like it. But I cant inderstand following example from documentation (From here - https://www.elastic.co/guide/en/elasticsearch/reference/7.2/query-dsl-intervals-query.html)
POST _search
{
"query": {
"intervals" : {
"my_text" : {
"match" : {
"query" : "hot porridge",
"filter" : {
"script" : {
"source" : "interval.start > 10 && interval.end < 20 && interval.gaps == 0"
}
}
}
}
}
}
}

Can somebody explain what the interval is ? Where did the start, end and gaps methods come from ? I reviewed painless documentation but not found any interesting regading this. Could you please simply explain me what this example does and give some similar examples.
Thank you in advance for your time

That is a so called interval script context, that does not seem to be documented at https://www.elastic.co/guide/en/elasticsearch/painless/7.5/painless-filter-context.html. Feel free to open a github issue about that.

This variable only exists, when scripts are called as part of the intervals query.