Search...ct::ML(3pm)
okay so bestie, sit down, hydrate ๐ this is the manpage for Search::Elasticsearch::Client::8_0::Direct::ML, straight off the User Contributed Perl Documentation shelf (yes it's a 3pm page, we're fancy like that). It's giving plugin energy and it is LONG, so buckle up โ this is part one, more is coming, don't go anywhere ๐ซถ
โจ NAME โจ
Search::Elasticsearch::Client::8_0::Direct::ML โ a plugin that provides the ML API for Search::Elasticsearch 8.x ๐ง โจ
๐ VERSION ๐
version 8.12. Yeah. She's on 8.12, no cap.
๐ SYNOPSIS ๐
my $response = $es->ml->start_datafeed(...)
๐ฆ DESCRIPTION ๐ฆ
This class extends the Search::Elasticsearch client with an "ml" namespace, so you can slide right into the Machine Learning APIs ๐
The full documentation for the ML feature is living at https://www.elastic.co/guide/en/x-pack/7.0/xpack-ml.html โ and yes, that's the exact same link twice in a row, the original said it twice so I'm saying it twice. Iconic of them honestly ๐ธ
๐ฅ DATAFEED METHODS ๐ฅ
put_datafeed()
$response = $es->ml->put_datafeed(
datafeed_id => $id # required
body => {...} # required
)
The put_datafeed() method lets you instantiate a datafeed โจ
The put_datafeed docs are at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html if you want the full lore.
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 ๐๏ธ
The delete_datafeed docs are at 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 ๐ main character energy, truly.
The start_datafeed docs are at 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 ๐
The stop_datafeed docs are at 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 ๐
The get_datafeeds docs are at 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, the original says "configuration information" here too โ I'm not the one who wrote it, I'm just the one who respects it ๐)
The get_datafeed_stats docs are at 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 ๐
The preview_datafeed docs are at 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 โ๏ธ
The update_datafeed docs are at 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 ๐ง
The put_job docs are at 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 ๐
The delete_job docs are at 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 ๐ (the way that job was closed and now it's open? obsessed.)
The open_job docs are at 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 ๐
The close_job docs are at 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 get_jobs docs are at 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 ๐ (and yes bestie, the heading says get_job_stats but the example calls get_jobs_stats โ I am reporting, not editing ๐)
The get_job_statss docs are at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html. (the double-s in "statss"? also theirs. copying it faithfully, that's the job ๐
)
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 ๐ฝโจ (okay that emoji is a choice, but the vibe is: it flushes. forcibly.)
The flush_job docs are at 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 ๐
The post_data docs are at 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 โ๏ธ
The update_job docs are at 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 ๐๏ธ (no args, no problem, she takes nothing and she takes it all away)
The delete_expired_data docs are at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html.
Query string parameters:
"error_trace""human"
okay that's part one, don't go anywhere bestie, there's more coming ๐ธ
๐ CALENDAR METHODS ๐
okay bestie, calendars are literally the scheduling queens of the ML world, and these methods are how you boss them around โจ
๐ put_calendar()
$response = $es->ml->put_calendar(
calendar_id => $id # required
body => {...} # optional
)
The put_calendar() method creates a brand new calendar. new calendar, who dis ๐
Query string parameters:
error_tracehuman
Peep the put calendar docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html for more info ๐ซถ
๐ delete_calendar()
$response = $es->ml->delete_calendar(
calendar_id => $id # required
)
The delete_calendar() method deletes the calendar you point at. it's gone, no cap ๐
Query string parameters:
error_tracehuman
Peep the delete_calendar docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html for more info ๐ซถ
๐ 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. matching them up like it's giving matchmaker energy ๐
Query string parameters:
error_tracehuman
Peep the put_calendar_job docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html for more info ๐ซถ
๐ 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. uncoupling era ๐ญ
Query string parameters:
error_tracehuman
Peep the delete_calendar_job docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html for more info ๐ซถ
๐ 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. yup, the sub name in the synopsis says post_calendar_events โ that's literally what it says, don't come for me ๐
Query string parameters:
error_tracehuman
Peep the post_calendar_events docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-events.html for more info ๐ซถ
๐ 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. bye event bestie ๐
Query string parameters:
error_tracehuman
Peep the delete_calendar_event docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html for more info ๐ซถ
๐ get_calendars()
$response = $es->ml->get_calendars(
calendar_id => $id, # optional
)
The get_calendars() method returns the calendar you asked for, or literally all the calendars if you didn't. pick your fighter โจ
Query string parameters:
error_tracefromhumansize
Peep the get_calendars docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html for more info ๐ซถ
๐ get_calendar_events()
$response = $es->ml->get_calendar_events(
calendar_id => $id, # required
)
The get_calendar_events() method retrieves events from a calendar. the receipts, as it were ๐
Query string parameters:
enderror_tracefromhumanjob_idsizestart
Peep the get_calendar_events docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html for more info ๐ซถ
๐ FILTER METHODS ๐
filters!! the little gatekeepers that decide what data actually matters. obsessed ๐
๐ฆ put_filter()
$response = $es->ml->put_filter(
filter_id => $id, # required
body => {...} # required
)
The put_filter() method creates a named filter. give it a name, give it a purpose โจ
Query string parameters:
error_tracehuman
Peep the put_filter docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html for more info ๐ซถ
๐ฆ 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, edit, whatever you need ๐
Query string parameters:
error_tracehuman
Peep the update_filter docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html for more info ๐ซถ
๐ฆ get_filters()
$response = $es->ml->get_filters(
filter_id => $id, # optional
)
The get_filters() method retrieves a named filter or all filters. one or all, your call bestie ๐
Query string parameters:
error_tracefromhumansize
Peep the get_filters docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filters.html for more info ๐ซถ
๐ฆ delete_filter()
$response = $es->ml->delete_filter(
filter_id => $id, # required
)
The delete_filter() method deletes a named filter. it's deleted, periodt ๐
Query string parameters:
error_tracehuman
Peep the delete_filters docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html for more info ๐ซถ
not me noticing the description says delete_filter but the docs link says "delete_filters" โ yes bestie, that's literally how the original is written, keeping it exactly ๐
๐ฎ FORECAST METHODS ๐ฎ
future-telling, but make it data. main character energy fr fr ๐
โญ forecast()
$response = $es->ml->forecast(
job_id => $id # required
)
The forecast() method enables you to create a new forecast. manifesting but with math ๐ง
Peep the forecast docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html for more info ๐ซถ
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. the prophecy is cancelled ๐ญ
Peep the delete_forecast docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html for more info ๐ซถ
Query string parameters:
allow_no_forecastserror_tracehumantimeout
๐ธ MODEL SNAPSHOT METHODS ๐ธ
snapshots!! saving the vibe so you can come back to it later ๐
๐ 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. sorry snapshot, you gotta go ๐
Peep the delete_model_snapshot docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html for more info ๐ซถ
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 tea on your snapshots โโจ
Peep the get_model_snapshots docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html for more info ๐ซถ
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. throw it back to a simpler time ๐ฐ๏ธ
Peep the revert_model_snapshot docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html for more info ๐ซถ
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. small edits, big impact ๐
Peep the update_model_snapshot docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html for more info ๐ซถ
Query string parameters:
error_tracehuman
๐ RESULT METHODS ๐
These are the ones that hand you back your actual results, bestie โ the receipts, the tea, the whole picture. Let's go one by one. ๐ซถ
๐ get_buckets
$response = $es->ml->get_buckets(
job_id => $job_id, # required
timestamp => $timestamp # optional
)
The get_buckets() method enables you to retrieve job results for one or more buckets. Bucket by bucket, iconic behavior only. โจ
See the get_buckets docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html> for more information.
Query string parameters:
"anomaly_score""desc""end""error_trace""exclude_interim""expand""from""human""size""sort""start"
๐ฆ get_overall_buckets
$response = $es->ml->get_overall_buckets(
job_id => $job_id, # required
)
The get_overall_buckets() method retrieves overall bucket results that summarize the bucket results of multiple jobs. It's giving executive summary energy โ one glow-up report for the whole friend group. ๐
See the get_overall_buckets docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html> for more information.
Query string parameters:
"allow_no_jobs""bucket_span""end""error_trace""exclude_interim""human""overall_score""start""top_n"
๐ get_categories
$response = $es->ml->get_categories(
job_id => $job_id, # required
category_id => $category_id # optional
)
The get_categories() method enables you to retrieve job results for one or more categories. Categorize, organize, slay. ๐
See the get_categories docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html> for more information.
Query string parameters:
"error_trace""from""human""size"
๐ธ get_influencers
$response = $es->ml->get_influencers(
job_id => $job_id, # required
)
The get_influencers() method enables you to retrieve job results for one or more influencers. Yes bestie, your ML job literally has influencers โ main character energy, fr fr. ๐
See the get_influencers docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html> for more information.
Query string parameters:
"desc""end""error_trace""exclude_interim""expand""from""human""influencer_score""size""sort""start"
โญ get_records
$response = $es->ml->get_records(
job_id => $job_id, # required
)
The get_records() method enables you to retrieve anomaly records for a job. Every weird little anomaly, documented. No cap. ๐
See the get_records docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html> for more information.
Query string parameters:
"desc""end""error_trace""exclude_interim""expand""from""human""record_score""size""sort""start"
๐ง 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 which contains data that is suitable to be ingested into Elasticsearch. Basically it sniffs the vibe of your file and tells you what shape it's in. ๐
See the find_file_structure docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html> for more information.
Query string parameters:
"charset""column_names""delimiter""error_trace""explain""format""grok_pattern""has_header_row""human""lines_to_sample""quote""should_trim_fields""timeout""timestamp_field""timestamp_format"
โจ INFO METHODS โจ
๐ info
$response = $es->ml->info();
The info() method returns defaults and limits used by machine learning. Just the facts, bestie โ what's default, what's the ceiling. ๐
See the find_file_structure docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html> for more information.
๐ Okay so heads up: the docs link in this one is literally labeled find_file_structure docs in the original. Not me fixing it, not me hiding it. That's just what it says. Keeping it real. ๐
Query string parameters:
"error_trace""human"
๐ฅ 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. It's the glow-up prep montage, but for indices. ๐
See the set_upgrade_mode docs <https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html> for more information.
Query string parameters:
"enabled""error_trace""human""timeout"
๐ซถ AUTHOR ๐ซถ
Enrico Zimuel <enrico.zimuel@elastic.co>
๐ COPYRIGHT AND LICENSE ๐
This software is Copyright (c) 2024 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
And that's the whole page, bestie โ you made it to the end and you ate. ๐
โจ This one's from perl v5.38.2, dated 2024-02-04, and it lives under the name Search...ct::ML(3pm). Go forth and query responsibly. ๐๐ฆ
๐ฆ where this page comes from
- debian trixie: libsearch-elasticsearch-perl 8.12-1 ยท Apache-2.0
- ubuntu noble: libsearch-elasticsearch-perl 8.12-1 ยท Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-perl 8.12-1 ยท Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-perl 8.12-1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms