Search...ct::ML(3pm)

๐Ÿ“ฆ
version 8.12 ยท 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

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_trace
  • human

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_trace
  • human

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_trace
  • human

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_trace
  • human

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_trace
  • human

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_trace
  • human

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_trace
  • from
  • human
  • size

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:

  • end
  • error_trace
  • from
  • human
  • job_id
  • size
  • start

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_trace
  • human

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_trace
  • human

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_trace
  • from
  • human
  • size

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_trace
  • human

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:

  • duration
  • error_trace
  • expires_in
  • human

โญ 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_forecasts
  • error_trace
  • human
  • timeout

๐Ÿ“ธ 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_trace
  • human

๐Ÿ“ 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:

  • desc
  • end
  • error_trace
  • from
  • human
  • size
  • sort
  • start

๐Ÿ“ 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_results
  • error_trace
  • human

๐Ÿ“ 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_trace
  • human

๐Ÿ’– 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>


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