Skip to content

enhancement: add elastic es text-structure (find-structure, find-field-structure, test-grok-pattern) #184

Description

@MattDevy

Summary

The _text_structure API family (find_structure, find_field_structure, find_message_structure, test_grok_pattern) is not exposed anywhere under elastic es. This API infers mappings and ingest pipelines from a sample of unstructured data — it is the core of "smart ingest" workflows where the user has a file but no schema.

Current surface

No commands under elastic es or elastic es ingest match text-structure or find-structure. Verified via:

elastic es --help | grep -iE "text|struct|infer"  # no hits

Missing endpoints

CLI command REST endpoint
elastic es text-structure find-structure POST /_text_structure/find_structure
elastic es text-structure find-field-structure GET /_text_structure/find_field_structure
elastic es text-structure find-message-structure POST /_text_structure/find_message_structure
elastic es text-structure test-grok-pattern POST /_text_structure/test_grok_pattern

Motivation / use case

The elasticsearch-file-ingest skill uses _text_structure/find_structure via node-es-transformer for the --infer-mappings workflow: agent receives a CSV/JSON/ND-JSON file, asks ES to propose mappings + an ingest pipeline, then ingests. This is a common enough workflow that it is the primary reason scripts/ingest.js is kept in the skill after the CLI migration (see PR #359).

Without CLI coverage, there is no elastic-native way to do schema inference — users must fall back to either curl -T data.csv "$ES/_text_structure/find_structure" or a Node helper.

find_structure takes a binary body (the sample) rather than JSON, which may need special handling in the codegen model — suggesting --input-file as the idiomatic way to pass it.

Codegen note

All four endpoints are in the ES OpenAPI spec under the text_structure namespace. If the codegen excludes them because of the non-JSON body, please flag that as a codegen limitation.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestskillsRelates to skills

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions