Elastic Stack (ELK Stack) Document API
The document API from Elastic Stack (ELK Stack) — 19 operation(s) for document.
Operations 33
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“Can I send a PUT to the cluster-wide bulk endpoint with actions naming their own indices?”
“Which query options let a PUT bulk request fail when the target is not an alias?”
Tell an agent
Send a PUT bulk request with mixed index and delete actions, running them through pipeline {pipeline}.
Using PUT on the root bulk endpoint, apply my batch with refresh set to {refresh}.
Ask an LLM
“How do I index thousands of documents in one request instead of one call each?”
“Can a single bulk POST mix create, update and delete actions across several indices?”
Tell an agent
POST this NDJSON batch of create, update and delete actions to the bulk endpoint.
Bulk-load my documents with routing {routing} and wait for {wait_for_active_shards} active shards.
PUT
/{index}/_bulk
Run bulk document actions via PUT on one index · Bulk index or delete documents
#
Ask an LLM
“Can I PUT a bulk batch scoped to one index so the actions don't repeat the index name?”
“Does a per-index PUT bulk request let me require the target to be a data stream?”
Tell an agent
PUT a bulk batch of actions into index {index}.
Using PUT, bulk write to {index} with require_data_stream {require_data_stream}.
Ask an LLM
“How do I bulk load documents into one specific index without naming it on every line?”
“Can I see which ingest pipelines ran for each document in an index-scoped bulk load?”
Tell an agent
Bulk index my documents into {index} and list the executed pipelines.
POST a bulk batch to index {index} through ingest pipeline {pipeline}.
PUT
/{index}/_create/{id}
Create a document only if its ID is new (PUT) · Create a new document in the index
#
Ask an LLM
“How do I add a document with a specific ID and fail if that ID already exists?”
“Can I create a new document with PUT on the _create endpoint and have it refresh immediately?”
Tell an agent
Create document {id} in {index} with PUT, failing if it already exists.
PUT a brand-new document {id} into {index} and refresh with {refresh}.
POST
/{index}/_create/{id}
Create a document only if its ID is new (POST) · Create a new document in the index
#
Ask an LLM
“Can I POST to the _create endpoint so a duplicate document ID is rejected rather than overwritten?”
“Which pipeline option applies when I POST a create-only document into a data stream?”
Tell an agent
POST to _create to add document {id} to {index} only if the ID is unused.
Using POST on _create, insert document {id} in {index} via pipeline {pipeline}.
Ask an LLM
“How do I fetch a single document and its source when I know the index and ID?”
“Is reading one document by ID realtime, or does it wait for the index refresh?”
Tell an agent
Get document {id} from index {index}.
Fetch document {id} in {index}, returning only source fields {_source_includes}.
PUT
/{index}/_doc/{id}
Index or replace a document with PUT · Create or update a document in an index
#
Ask an LLM
“How do I save a JSON document under my own ID, overwriting it if it exists?”
“Can I make a PUT document write conditional on its sequence number and primary term?”
Tell an agent
PUT this JSON as document {id} in {index}, replacing any existing version.
Overwrite document {id} in {index} only if its seq_no is {if_seq_no}.
POST
/{index}/_doc/{id}
Index or replace a document with POST and an ID · Create or update a document in an index
#
Ask an LLM
“Can I POST a document to _doc with an explicit ID to add or overwrite it?”
“Which op_type should I pass to a POST _doc request so it only creates?”
Tell an agent
POST my JSON to _doc as document {id} in index {index}.
Using POST with ID {id}, write to {index} with op_type {op_type}.
Ask an LLM
“How do I remove a single document from an index when I know its ID?”
“Why can't I delete a document directly from a data stream by ID?”
Tell an agent destructive · confirm first
Delete document {id} from index {index}.
Remove document {id} in {index} only if its primary term is {if_primary_term}.
Ask an LLM
“Is there a quick way to tell if a document ID exists without downloading it?”
“What status do I get back when a document I'm checking for is missing?”
Tell an agent
Check whether document {id} exists in {index}.
Confirm document {id} is present in {index} using routing {routing}.
Ask an LLM
“How do I delete every document that matches a search, not just one ID?”
“Can I cap how many matching documents a delete-by-query removes?”
Tell an agent destructive · confirm first
Delete all documents in {index} matching query {query}.
Delete up to {max_docs} matching documents from {index}, proceeding on conflicts.
POST
/_delete_by_query/{task_id}/_rethrottle
Change the speed of a running delete by query · Throttle a delete by query operation
#
Ask an LLM
“Can I slow down a delete-by-query that is hammering my cluster?”
“Does speeding up a running delete by query take effect immediately?”
Tell an agent
Rethrottle delete-by-query task {task_id} to {requests_per_second} requests per second.
Unthrottle the delete by query task {task_id} by setting its rate to {requests_per_second}.
Ask an LLM
“How do I get just the original JSON body of a document without the metadata wrapper?”
“Can I filter which source fields come back when retrieving only a document's _source?”
Tell an agent
Return just the _source of document {id} in {index}.
Get the raw source of {id} from {index}, excluding fields {_source_excludes}.
HEAD
/{index}/_source/{id}
Check whether a document's source is stored · Check for a document source
#
Ask an LLM
“How can I tell if a document's _source is available, since it may be disabled in the mapping?”
“Is there a HEAD check for the stored source rather than the document itself?”
Tell an agent
Check whether the _source of document {id} in {index} is available.
Verify a stored source exists for {id} in {index} at version {version}.
POST
/{index}/_doc
Add a document with an auto-generated ID · Create or update a document in an index
#
Ask an LLM
“How do I add a document and let the cluster generate its ID for me?”
“Can I append a log event to a data stream without choosing an ID?”
Tell an agent
Add this JSON document to {index} with an auto-generated ID.
Append a new event to data stream {index} through pipeline {pipeline}, letting it assign the ID.
Ask an LLM
“How do I copy all documents from an old index into a new one?”
“Can I reindex only a subset of documents or transform them with a script on the way?”
Tell an agent
Reindex documents from {source} into {dest}.
Copy at most {max_docs} documents from {source} to {dest}.
Ask an LLM
“How do I retrieve a batch of documents from different indices in one GET?”
“Can a multi-get pull documents by index and ID pairs with no index in the URL?”
Tell an agent
Multi-get the documents listed in {docs}, each with its own index and ID.
With a GET multi-get across indices, fetch {docs} returning only stored fields {stored_fields}.
Ask an LLM
“Can I POST a multi-get body naming documents from several indices at once?”
“Is there a POST form of multi-get for clients that can't send a GET body?”
Tell an agent
POST a multi-get for document specs {docs} spread over several indices.
Using POST multi-get with no index in the path, retrieve {docs} realtime {realtime}.
Ask an LLM
“How do I get several documents from one index by just listing their IDs?”
“Can I multi-get from a single index and filter the source fields returned?”
Tell an agent
Get documents with IDs {ids} from index {index}.
From {index}, GET multiple documents {ids} including only fields {_source_includes}.
Ask an LLM
“Can I POST a list of IDs to one index's multi-get endpoint?”
“Is there a POST version of index-scoped multi-get that honors routing?”
Tell an agent
POST IDs {ids} to the multi-get endpoint of {index}.
Using POST, multi-get {ids} in {index} with routing {routing}.
Ask an LLM
“How do I get term statistics for several documents across indices in one GET request?”
“Can I request term vectors for artificial documents I provide rather than stored ones?”
Tell an agent
Get term vectors for documents {docs} across my indices.
Fetch multi term vectors for {docs} with term statistics {term_statistics}.
Ask an LLM
“Can I POST a batch of document references to get their term vectors together?”
“Which positions and offsets can I include when posting a multi term vectors request?”
Tell an agent
POST a multi term vectors request for documents {docs}.
Using POST, get term vectors for {docs} restricted to fields {fields}.
GET
/{index}/_mtermvectors
Get term vectors for many documents in one index · Get multiple term vectors
#
Ask an LLM
“How do I get term vectors for a list of document IDs within a single index?”
“Can I skip field statistics when pulling term vectors for many docs in one index?”
Tell an agent
Get term vectors for IDs {ids} in index {index}.
Fetch multi term vectors from {index} for {ids} with field statistics {field_statistics}.
POST
/{index}/_mtermvectors
Get term vectors for many docs in an index (POST) · Get multiple term vectors
#
Ask an LLM
“Can I POST document specs to one index's multi term vectors endpoint?”
“Is there a POST form for index-scoped multi term vectors with payloads included?”
Tell an agent
POST a multi term vectors request for {docs} to index {index}.
Using POST on {index}, get term vectors for {docs} including payloads {payloads}.
POST
/_reindex/{task_id}/_rethrottle
Change the speed of a running reindex · Throttle a reindex operation
#
Ask an LLM
“Can I throttle a reindex that's already running?”
“How do I remove the rate limit from a reindex in progress?”
Tell an agent
Rethrottle reindex task {task_id} to {requests_per_second} documents per second.
Unthrottle reindex {task_id} completely by setting requests per second to {requests_per_second}.
GET
/{index}/_termvectors/{id}
Get term vectors for one stored document · Get term vector information
#
Ask an LLM
“How do I see the terms, frequencies and positions for the fields of a single document?”
“Can I get term statistics for one stored document using a different analyzer per field?”
Tell an agent
Get term vectors for document {id} in {index}.
Show term vectors of {id} in {index} for fields {fields} with offsets.
POST
/{index}/_termvectors/{id}
Get term vectors for one stored document (POST) · Get term vector information
#
Ask an LLM
“Can I POST a filter body to trim the term vectors returned for a single document?”
“Is there a POST variant of per-document term vectors that accepts per-field analyzers?”
Tell an agent
POST a term vectors request for document {id} in {index}.
Using POST, get term vectors of {id} in {index} filtered by {filter}.
GET
/{index}/_termvectors
Get term vectors for an artificial document · Get term vector information
#
Ask an LLM
“How do I analyze term vectors for text I supply that isn't stored in the index?”
“Can I get term statistics for an ad-hoc document against an index's mappings?”
Tell an agent
Compute term vectors in {index} for text I supply as {doc}, not a stored document.
Analyze supplied doc {doc} against {index} with per-field analyzer {per_field_analyzer}.
POST
/{index}/_termvectors
Get term vectors for an artificial doc (POST) · Get term vector information
#
Ask an LLM
“Can I POST an inline document to an index to get its term vectors without saving it?”
“Is there a POST route for term vectors of supplied text with no document ID?”
Tell an agent
POST inline document {doc} to {index} and return its term vectors.
Using POST with no ID, compute term vectors of {doc} in {index} with positions {positions}.
Ask an LLM
“How do I change a few fields of a document without resending the whole thing?”
“Can I update a document with a script, or insert it if it doesn't exist yet?”
Tell an agent
Update document {id} in {index} with partial fields {doc}.
Run script {script} on document {id} in {index}.
Ask an LLM
“How do I apply a change to every document that matches a query?”
“Can I re-run an ingest pipeline over existing documents in place after a mapping change?”
Tell an agent
Update every document in {index} matching {query} with script {script}.
Reprocess all documents in {index} in place through pipeline {pipeline}.
POST
/_update_by_query/{task_id}/_rethrottle
Change the speed of a running update by query · Throttle an update by query operation
#
Ask an LLM
“Can I speed up or slow down an update-by-query that's in progress?”
“Does lowering the rate of a running update by query apply right away?”
Tell an agent
Rethrottle update-by-query task {task_id} to {requests_per_second} per second.
Slow the update by query job {task_id} down to {requests_per_second} requests per second.