Query AI Indices
https://{kibana_url}
- POST /api/context_engine/ai_index/_query
- POST /s/{space_id}/api/context_engine/ai_index/_query
Refer to Spaces for more information.
Runs an ES|QL query as the current user. The server applies a space filter and limits the response to at most 1000 rows.
The query determines which indices it reads. Elasticsearch index privileges limit which indices the current user can access.
The space comes from the request URL (/s/{spaceId}/…) or defaults to the default space. The request body cannot change the space or replace the space filter.
Returns a 404 response when Context Engine is turned off in this space (contextEngine:enabled).
For more information, refer to the Context Engine documentation.
[Required authorization] Route required privileges: contextEngine:read.
Request
-
limitnumber · min: 1 · max: 1000 -
Maximum rows to return. Defaults to 100; a trailing
LIMITin the query is capped to this value. -
paramsmap string to string | number | boolean -
Values for
?nameplaceholders in the query. -
querystring · min: 1 · max: 10000required -
The ES|QL query to run. Its FROM decides which Elasticsearch indices are read (normally
ai-index-*); the server adds the space filter and a row limit.
Responses
The columns and rows returned by the ES|QL query.
The ES|QL query was invalid, or its response exceeded the size limit.
-
errorstring -
The HTTP status text.
-
messagestringrequired -
A human-readable error message.
-
statusCodenumber -
The HTTP status code.
Elasticsearch rejected the read; the caller lacks index privileges.
-
errorstring -
The HTTP status text.
-
messagestringrequired -
A human-readable error message.
-
statusCodenumber -
The HTTP status code.
Context Engine is turned off in this space.
-
errorstring -
The HTTP status text.
-
messagestringrequired -
A human-readable error message.
-
statusCodenumber -
The HTTP status code.