Search...ct::ML(3pm)
๐ NAME ๐
Search::Elasticsearch::Client::7_0::Direct::ML โ it's a plugin, bestie, and it hands the Search::Elasticsearch 7.x client the whole entire ML API. Periodt.
โจ VERSION โจ
version 7.715 ๐ธ
๐ฆ SYNOPSIS ๐ฆ
my $response = $es->ml->start_datafeed(...)
๐ DESCRIPTION ๐
Okay so listen. This class extends the Search::Elasticsearch client with an "ml" namespace, so you can go do Machine Learning things. The Machine Learning APIs live here:
https://www.elastic.co/guide/en/x-pack/7.0/xpack-ml.html
And the full documentation for the ML feature? Right here, same vibe, same URL, she's serving:
https://www.elastic.co/guide/en/x-pack/7.0/xpack-ml.html
๐ DATAFEED METHODS ๐
๐
put_datafeed()
$response = $es->ml->put_datafeed(
datafeed_id => $id # required
body => {...} # required
)
The put_datafeed() method lets you instantiate a datafeed. Slay.
See the put_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html
Query string parameters:
"error_trace""human"
๐
delete_datafeed()
$response = $es->xpack->ml->delete_datafeed(
datafeed_id => $id # required
)
The delete_datafeed() method lets you delete a datafeed. Gone, she's gone.
See the delete_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html
Query string parameters:
"error_trace""force""human"
๐
start_datafeed()
$response = $es->ml->start_datafeed(
datafeed_id => $id # required
)
The start_datafeed() method lets you start a datafeed. Run bestie run ๐โ๏ธ
See the start_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
Query string parameters:
"end""error_trace""human""start""timeout"
๐
stop_datafeed()
$response = $es->ml->stop_datafeed(
datafeed_id => $id # required
)
The stop_datafeed() method lets you stop a datafeed. Nap time.
See the stop_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
Query string parameters:
"allow_no_datafeeds""error_trace""force""human""timeout"
๐
get_datafeeds()
$response = $es->ml->get_datafeeds(
datafeed_id => $id # optional
)
The get_datafeeds() method lets you retrieve configuration information for datafeeds. Receipts, basically.
See the get_datafeeds docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html
Query string parameters:
"allow_no_datafeeds""error_trace""human"
๐
get_datafeed_stats()
$response = $es->ml->get_datafeed_stats(
datafeed_id => $id # optional
)
The get_datafeed_stats() method lets you retrieve configuration information for datafeeds. (Yes, same sentence as above, that's literally what it says, no cap.)
See the get_datafeed_stats docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html
Query string parameters:
"allow_no_datafeeds""error_trace""human"
๐
preview_datafeed()
$response = $es->ml->preview_datafeed(
datafeed_id => $id # required
)
The preview_datafeed() method lets you preview a datafeed. A little sneak peek, a little trailer drop ๐ฌ
See the preview_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html
Query string parameters:
"error_trace""human"
๐
update_datafeed()
$response = $es->ml->update_datafeed(
datafeed_id => $id # required
body => {...} # required
)
The update_datafeed() method lets you update certain properties of a datafeed. Glow up, but only the parts you're allowed to touch.
See the update_datafeed docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
Query string parameters:
"error_trace""human"
๐ JOB METHODS ๐
๐ put_job()
$response = $es->ml->put_job(
job_id => $id # required
body => {...} # required
)
The put_job() method lets you instantiate a job. Iconic behaviour.
See the put_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html
Query string parameters:
"error_trace""human"
๐ delete_job()
$response = $es->ml->delete_job(
job_id => $id # required
)
The delete_job() method lets you delete a job. Bye forever ๐ซถ
See the delete_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html
Query string parameters:
"error_trace""force""human""wait_for_completion"
๐ open_job()
$response = $es->ml->open_job(
job_id => $id # required
)
The open_job() method lets you open a closed job. She's awake again ๐
See the open_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html
Query string parameters:
"error_trace""human"
๐ close_job()
$response = $es->ml->close_job(
job_id => $id # required
)
The close_job() method lets you close an open job. Night night, don't let the anomaly bugs bite ๐ด
See the close_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html
Query string parameters:
"allow_no_jobs""error_trace""force""human""timeout"
๐ get_jobs()
$response = $es->ml->get_jobs(
job_id => $id # optional
)
The get_jobs() method lets you retrieve configuration information for jobs. The lore, basically.
See the get_jobs docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html
Query string parameters:
"allow_no_jobs""error_trace""human"
๐ get_job_stats()
$response = $es->ml->get_jobs_stats(
job_id => $id # optional
)
The get_jobs_stats() method lets you retrieve usage information for jobs. The numbers, the tea, the whole report card.
See the get_job_statss docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html
Not me pointing out that the synopsis saysget_jobs_statswhile the method is calledget_job_stats, and the docs link saysget_job_statss. ๐ I am not touching a single character of any of it, that's exactly how she was written, and we respect her.
Query string parameters:
"allow_no_jobs""error_trace""human"
๐ flush_job()
$response = $es->ml->flush_job(
job_id => $id # required
)
The flush_job() method forces any buffered data to be processed by the job. Everything in the queue, out the door, immediately. No holding onto it ๐
See the flush_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
Query string parameters:
"advance_time""calc_interm""end""error_trace""human""skip_time""start"
๐ post_data()
$response = $es->ml->post_data(
job_id => $id # required
body => [data] # required
)
The post_data() method lets you send data to an anomaly detection job for analysis. Feed the algorithm, she's hungry ๐ฝ๏ธ
See the post_data docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html
Query string parameters:
"error_trace""human""reset_end""reset_start"
๐ update_job()
$response = $es->ml->update_job(
job_id => $id # required
body => {...} # required
)
The update_job() method lets you update certain properties of a job. Small tweaks only, we're not rebuilding the whole girl.
See the update_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
Query string parameters:
"error_trace""human"
๐ delete_expired_data
$response = $es->ml->delete_expired_data(
)
The delete_expired_data() method deletes expired machine learning data. Spring cleaning, but make it ML ๐งนโจ
See the delete_expired_data docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html
Query string parameters:
"error_trace""human"
๐๏ธ CALENDAR METHODS ๐๏ธ
okay bestie, calendars are literally the scheduling era of ML. let's go ๐
๐
put_calendar()
$response = $es->ml->put_calendar(
calendar_id => $id # required
body => {...} # optional
)
the put_calendar() method creates a new calendar. brand new, fresh out the box, main character debut โจ
query string parameters:
error_tracehuman
see the put calendar docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html ๐ฆ
๐ delete_calendar()
$response = $es->ml->delete_calendar(
calendar_id => $id # required
)
the delete_calendar() method deletes the specified calendar. gone, girl. no cap ๐
query string parameters:
error_tracehuman
see the delete_calendar docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html ๐ธ
โจ put_calendar_job()
$response = $es->ml->put_calendar_job(
calendar_id => $id, # required
job_id => $id # required
)
the put_calendar_job() method adds a job to a calendar. it's giving matchmaker energy, ngl ๐ซถ
query string parameters:
error_tracehuman
see the put_calendar_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html ๐
๐ delete_calendar_job()
$response = $es->ml->delete_calendar_job(
calendar_id => $id, # required
job_id => $id # required
)
the delete_calendar_job() method deletes a job from a calendar. breaking up the pairing, respectfully ๐ญ
query string parameters:
error_tracehuman
see the delete_calendar_job docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html ๐ฆ
๐ put_calendar_event()
$response = $es->ml->post_calendar_events(
calendar_id => $id, # required
body => {...} # required
)
the post_calendar_events() method adds scheduled events to a calendar. yes the heading says put_calendar_event() and the actual call is post_calendar_events() โ that's just how it is, iykyk, copy it exactly ๐
query string parameters:
error_tracehuman
see the post_calendar_events docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-events.html โจ
๐ง delete_calendar_event()
$response = $es->ml->delete_calendar_event(
calendar_id => $id, # required
event_id => $id # required
)
the delete_calendar_event() method deletes an event from a calendar. cancel that plan bestie ๐
query string parameters:
error_tracehuman
see the delete_calendar_event docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html ๐
๐ get_calendars()
$response = $es->ml->get_calendars(
calendar_id => $id, # optional
)
the get_calendars() method returns the specified calendar or all calendars. give it an id and it hands you that one, leave it out and it's the whole friend group โจ
query string parameters:
error_tracefromhumansize
see the get_calendars docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html ๐
๐ฅ get_calendar_events()
$response = $es->ml->get_calendar_events(
calendar_id => $id, # required
)
the get_calendar_events() method retrieves events from a calendar. pull up, we're going through the schedule ๐
query string parameters:
enderror_tracefromhumanjob_idsizestart
see the get_calendar_events docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html ๐ธ
๐ฏ FILTER METHODS ๐ฏ
filters!! the little named lists that keep your ML jobs from spiralling. obsessed ๐
๐ put_filter()
$response = $es->ml->put_filter(
filter_id => $id, # required
body => {...} # required
)
the put_filter() method creates a named filter. named, bestie. it has a whole identity โจ
query string parameters:
error_tracehuman
see the put_filter docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html ๐ฆ
๐ update_filter()
$response = $es->ml->update_filter(
filter_id => $id, # required
body => {...} # required
)
the update_filter() method updates the description of a filter, adds items, or removes items. glow-up, restock, declutter โ pick your era ๐
query string parameters:
error_tracehuman
see the update_filter docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html ๐
๐ธ get_filters()
$response = $es->ml->get_filters(
filter_id => $id, # optional
)
the get_filters() method retrieves a named filter or all filters. one, or the whole lineup ๐
query string parameters:
error_tracefromhumansize
see the get_filters docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filters.html ๐
๐ delete_filter()
$response = $es->ml->delete_filter(
filter_id => $id, # required
)
the delete_filter() method deletes a named filter. poof. that filter? never met her ๐ญ
query string parameters:
error_tracehuman
see the delete_filters docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html ๐ง
๐ฎ FORECAST METHODS ๐ฎ
manifesting the future, but make it stats โจ
๐ forecast()
$response = $es->ml->forecast(
job_id => $id # required
)
the forecast() method enables you to create a new forecast. yes bestie, it literally predicts the vibe ๐
see the forecast docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html ๐
query string parameters:
durationerror_traceexpires_inhuman
๐ฆ delete_forecast()
$response = $es->ml->delete_forecast(
forecast_id => $id, # required
job_id => $id # required
)
the delete_forecast() method enables you to delete an existing forecast. un-manifesting, we love to see it ๐
see the delete_forecast docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html ๐
query string parameters:
allow_no_forecastserror_tracehumantimeout
๐ธ MODEL SNAPSHOT METHODS ๐ธ
snapshots = the receipts of your ML job's journey. scrapbook core ๐ธ
๐๏ธ delete_model_snapshot()
$response = $es->ml->delete_model_snapshot(
snapshot_id => $id # required
)
the delete_model_snapshot() method enables you to delete an existing model snapshot. yeah that memory is leaving the chat ๐
see the delete_model_snapshot docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html ๐ฆ
query string parameters:
error_tracehuman
๐ get_model_snapshots()
$response = $es->ml->get_model_snapshots(
job_id => $job_id, # required
snapshot_id => $snapshot_id # optional
)
the get_model_snapshots() method enables you to retrieve information about model snapshots. the job_id is required, the snapshot_id is optional โ so you can pull one specific snapshot or the whole camera roll ๐ท
see the get_model_snapshots docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html ๐
query string parameters:
descenderror_tracefromhumansizesortstart
โช revert_model_snapshot()
$response = $es->ml->revert_model_snapshot(
job_id => $job_id, # required
snapshot_id => $snapshot_id # required
)
the revert_model_snapshots() method enables you to revert to a specific snapshot. it's giving time travel, no cap โณ
see the revert_model_snapshot docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html ๐
query string parameters:
delete_intervening_resultserror_tracehuman
โ๏ธ update_model_snapshot()
$response = $es->ml->update_model_snapshot(
job_id => $job_id, # required
snapshot_id => $snapshot_id # required
)
the update_model_snapshots() method enables you to update certain properties of a snapshot. little tweak, little refresh, still iconic ๐
see the update_model_snapshot docs for more info: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html ๐
query string parameters:
error_tracehuman
๐ RESULT METHODS ๐
okay bestie, this is where the actual tea lives โ all the results your jobs cooked up. let's get into it ๐ฅ
get_buckets()
$response = $es->ml->get_buckets(
job_id => $job_id, # required
timestamp => $timestamp # optional
)
the get_buckets() method lets you pull job results for one or more buckets. buckets!! the little time-windows where your anomaly detection does its thing โจ
the full deets live in the get_buckets docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
query string parameters, no cap:
anomaly_scoredescenderror_traceexclude_interimexpandfromhumansizesortstart
get_overall_buckets()
$response = $es->ml->get_overall_buckets(
job_id => $job_id, # required
)
the get_overall_buckets() method grabs overall bucket results that summarize the bucket results of multiple jobs. it's giving group-project energy but, like, the good kind ๐ซถ
the get_overall_buckets docs are right here: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html
query string parameters:
allow_no_jobsbucket_spanenderror_traceexclude_interimhumanoverall_scorestarttop_n
get_categories()
$response = $es->ml->get_categories(
job_id => $job_id, # required
category_id => $category_id # optional
)
the get_categories() method lets you retrieve job results for one or more categories. sorting your anomalies into lil categories? iconic, honestly ๐
get_categories docs over here: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html
query string parameters:
error_tracefromhumansize
get_influencers()
$response = $es->ml->get_influencers(
job_id => $job_id, # required
)
the get_influencers() method lets you retrieve job results for one or more influencers. yes, your data has influencers now. main character fields, periodt ๐
get_influencers docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html
query string parameters:
descenderror_traceexclude_interimexpandfromhumaninfluencer_scoresizesortstart
get_records()
$response = $es->ml->get_records(
job_id => $job_id, # required
)
the get_records() method lets you retrieve anomaly records for a job. the receipts, bestie. literally the receipts ๐งพโจ
get_records docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
query string parameters:
descenderror_traceexclude_interimexpandfromhumanrecord_scoresizesortstart
๐ FILE STRUCTURE METHODS ๐
find_file_structure
$response = $es->ml->find_file_structure(
body => { ... }, # required
)
the find_file_structure() method finds the structure of a text file that contains data suitable to be ingested into Elasticsearch. it's like a vibe check, but for your file's schema ๐
find_file_structure docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
query string parameters:
charsetcolumn_namesdelimitererror_traceexplainformatgrok_patternhas_header_rowhumanlines_to_samplequoteshould_trim_fieldstimeouttimestamp_fieldtimestamp_format
โญ INFO METHODS โญ
info
$response = $es->ml->info();
the info() method returns the defaults and limits used by machine learning. it's the ML subsystem handing you its whole stat sheet, and we love a transparent king ๐
the docs for this one are (yes, the original calls them this) the find_file_structure docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html
query string parameters:
error_tracehuman
๐ UPGRADE METHODS ๐
set_upgrade_mode
$response = $es->ml->set_upgrade_mode();
the set_upgrade_mode() method sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. glow-up time for your indices, fr fr โจ
heads up bestie: this is cluster wide, so it's not a little personal setting โ it touches the whole cluster, okay?
set_upgrade_mode docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html
query string parameters:
enablederror_tracehumantimeout
๐ AUTHOR ๐
Enrico Zimuel <enrico.zimuel@elastic.co>
the genius behind this whole thing, we stan ๐ซถ
๐ COPYRIGHT AND LICENSE ๐
This software is Copyright (c) 2021 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's a wrap on the whole page, bestie!! ๐ this was documented for perl v5.32.1, dated 2021-10-23, and it's the Search...ct::ML(3pm) page from the User Contributed Perl Documentation. go forth and machine-learn responsibly, ily, bye ๐๐ฆ๐ธ
๐ฆ where this page comes from
- ubuntu jammy: libsearch-elasticsearch-perl 7.715-1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms