Skip to content

Measure

The measure endpoints are used for metric event collection and reporting for Searchcraft Cloud. If you are using Searchcraft Cloud and an SDK or CMS integration you do not need to use these endpoints directly. If you are using an API implementation these endpoints are available for use for capturing usage metrics.

API Endpoints

  • GET /measure/dashboard/summary Returns measurement dashboard summary data.
  • POST /measure/event Handles a measure event.
  • POST /measure/batch Handles a measure batch request.

The following payload structure is used for meaure event requests. /measure/batch expects an array of MeasureRequest json objects, /measure/event expects a single event.

/**
* The type representing a measure request.
*/
export interface MeasureRequest {
event_name: MeasureEventName;
properties: MeasureRequestProperties;
user: MeasureRequestUser;
}
/**
* Properties attached to a measure request.
*/
export interface MeasureRequestProperties {
searchcraft_organization_id?: string;
searchcraft_application_id?: string;
searchcraft_index_names: string[];
search_term?: string;
number_of_documents?: number;
external_document_id?: string;
document_position?: number;
session_id?: string;
}
/**
* User properties attached to a measure request.
*/
export interface MeasureRequestUser {
user_id: string;
country?: string;
city?: string;
device_id?: string;
client_ip?: string;
locale?: string;
os?: string;
platform?: string;
region?: string;
sdk_name?: string;
sdk_version?: string;
user_agent?: string;
latitude?: number;
longitude?: number;
}

Auth Requirement

Requires an authentication key that has ingestion permissions.

Self-Hosted Support

Self-hosted instances of Searchcraft may also make use of these endpoints but that involves setting up a Clickhouse cluster and configuring the Searchcraft instance to use it. Managing and hosting Clickhouse clusters are outside the scope of this documentation and are not supported by Searchcraft technical support.