# Machine Learning Real-Time Job stopping after initial run

**URL:** <https://discuss.elastic.co/t/machine-learning-real-time-job-stopping-after-initial-run/96524>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [August 9, 2017, 10:55pm UTC](https://discuss.elastic.co/t/machine-learning-real-time-job-stopping-after-initial-run/96524 "2017-08-09T22:55:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dmitri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitri/32/17997_2.png) [@dmitri](https://discuss.elastic.co/u/dmitri)\
**Post date:** [August 10, 2017, 9:14am UTC](https://discuss.elastic.co/t/machine-learning-real-time-job-stopping-after-initial-run/96524/3 "2017-08-10T09:14:37Z")

</div>

Hi Jonathan,

The datafeed has 2 parameters that determine when it is querying for data: `frequency` and `query_delay`. You can read more about them in [create-datafeed-API](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/ml-put-datafeed.html). In a nutshell, `frequency` is how often the feed queries elasticsearch for data and `query_delay` allows time for data to be indexed in elasticsearch by never querying for data after `now - query_delay`.

I suspect that in your case data is not available for search yet by the time the datafeed queries for them. As it seems you have polled data (every 5 minutes), I recommend setting `frequency` to 5 minutes and see what happens. If you still get no data, I suggest adjusting `query_delay` in order to find the right delay that it takes for you data to be indexed in elasticsearch.

---

_[View the full topic](https://discuss.elastic.co/t/machine-learning-real-time-job-stopping-after-initial-run/96524)._
