🔍

Search Documents

Verified

@elastic/search-documents

Full-text search across any Elasticsearch index

Usage

RUN SKILL search_documents()

With parameters:

RUN SKILL search_documents WITH query = 'value', index_pattern = 'value', limit = 0

Parameters

NameTypeDefaultDescription
querySTRINGSearch query - keywords or phrase to search for
index_patternSTRINGIndex pattern to search (e.g., products-*, users-*)
limitINTMaximum results to return

Returns

ARRAY— An array of matching documents

Example

-- Using curl
curl -u elastic-admin:elastic-password http://localhost:9200/_escript \
  -H "Content-Type: application/json" \
  -d '{"query": "RUN SKILL search_documents()"}'

-- Response
{
  "result": [...],
  "_meta": {
    "execution_id": "abc123",
    "duration_ms": 45
  }
}