You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

The Analytics endpoints provide functionality to retrieve analytics data from the Search API.

Top Queries

Get the top 5 queries of a specific source.

Parameters

ParameterTypeDescription
sourcestringSource ID stored in the engine (usually the index

Example

GET /es/api/v1/analytics/topQueries?source=my_index

Response

Successful Response [200]

[ "query1", "query2", "query3", "query4", "query5" ]

Validation Error [422]

{ "detail": [ { "loc": ["query", "source"], "msg": "field required", "type": "value_error.missing" } ] }

User Queries

Get the last queries from the current user.

Parameters

ParameterTypeDescription
sourcestringSource ID stored in the engine (usually the index)
sizeintegerNumber of queries to return (optional, default: 6)

Example

GET /es/api/v1/analytics/userQueries?source=my_index&size=10

Response

Successful Response [200]

[ "query1", "query2", "query3", "query4", "query5" ]

Validation Error [422]

{ "detail": [ { "loc": ["query", "source"], "msg": "field required", "type": "value_error.missing" } ] }

Suggested Queries

Get suggested queries based on a given query.

Parameters

ParameterTypeDescription
sourcestringSource ID stored in the engine (usually the index)
qstringQuery to look for in stored queries
sizeintegerNumber of queries to return (optional, default: 6)

Example

 POST /es/api/v1/analytics/suggestedQueries?source=my_index&q=my_query&size=5

Response

Successful Response [200]

[ "suggested_query1", "suggested_query2", "suggested_query3", "suggested_query4", "suggested_query5" ]

Validation Error [422]

{ "detail": [ { "loc": ["query", "source"], "msg": "field required", "type": "value_error.missing" } ] }
  • No labels