Skip to main content

elasticsearch-store / elasticsearch-client/client / Client

Class: Client

Constructors

new Client()

new Client(client, distributionMeta): Client

Parameters

ParameterType
clientany
distributionMetaClientMetadata

Returns

Client

Source

elasticsearch-store/src/elasticsearch-client/client.ts:8

Accessors

__meta

get __meta(): ClientMetadata

Returns

ClientMetadata

Source

elasticsearch-store/src/elasticsearch-client/client.ts:16


cat

get cat(): object

Returns

object

indices()
Parameters
ParameterType
paramsCatIndicesParams
Returns

Promise<CatIndicesResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:137


cluster

get cluster(): object

Returns

object

getSettings()
Parameters
ParameterType
paramsClusterGetSettingsParams
Returns

Promise<ClusterGetSettingsResponse>

health()
Parameters
ParameterType
paramsClusterHealthParams
Returns

Promise<ClusterHealthResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:103


indices

get indices(): object

Returns

object

create()

Creates a new index.

Parameters
ParameterType
paramsIndicesCreateParams
Returns

Promise<IndicesCreateResponse>

IndicesCreateResponse

delete()

Deletes one or more indices.

Parameters
ParameterType
paramsIndicesDeleteParams
Returns

Promise<IndicesDeleteResponse>

deleteTemplate()

Deletes index templates

Parameters
ParameterType
paramsIndicesDeleteTemplateParams
Returns

Promise<IndicesDeleteTemplateResponse>

IndicesDeleteTemplateResponse

exists()

Checks if a data stream, index, or alias exists.

Parameters
ParameterType
paramsIndicesExistsParams
Returns

Promise<boolean>

boolean

existsTemplate()

Returns true if template exists

Parameters
ParameterType
paramsIndicesExistsTemplateParams
Returns

Promise<boolean>

boolean

get()

Returns information about one or more indices

Parameters
ParameterType
paramsIndicesGetParams
Returns

Promise<IndicesGetResponse>

getFieldMapping()

Retrieves mapping definitions for one or more fields.

Parameters
ParameterType
paramsIndicesGetFieldMappingParams
Returns

Promise<IndicesGetFieldMappingResponse>

Response

IndicesGetFieldMappingResponse

getIndexTemplate()

Returns index template

Parameters
ParameterType
paramsIndicesGetIndexTemplateParams
Returns

Promise<IndicesGetIndexTemplateResponse>

IndicesGetIndexTemplateResponse not supported by elasticsearch version 6 same params as IndicesGetTemplateParams

getMapping()

Retrieves mapping definitions for one or more indices

Parameters
ParameterType
paramsIndicesGetMappingParams
Returns

Promise<IndicesGetMappingResponse>

IndicesGetMappingResponse

getSettings()

Returns setting information for one or more indices

Parameters
ParameterType
paramsIndicesGetSettingsParams
Returns

Promise<IndicesGetSettingsResponse>

IndicesGetSettingsResponse

getTemplate()

Returns template

Parameters
ParameterType
paramsIndicesGetTemplateParams
Returns

Promise<IndicesGetTemplateResponse>

template

putMapping()

Adds new fields to an existing index or edit the search settings of existing fields.

Parameters
ParameterType
paramsIndicesPutMappingParams
Returns

Promise<IndicesPutMappingResponse>

IndicesPutMappingResponse

putSettings()

Changes a dynamic index setting in real time.

Parameters
ParameterType
paramsIndicesPutSettingsParams
Returns

Promise<IndicesPutSettingsResponse>

IndicesPutSettingsResponse

putTemplate()

Uploads index mapping template

Parameters
ParameterType
paramsIndicesPutTemplateParams
Returns

Promise<IndicesPutTemplateResponse>

IndicesPutTemplateResponse

recovery()

Returns information about shard recoveries for one or more indices

Parameters
ParameterType
paramsIndicesRecoveryParams
Returns

Promise<IndicesRecoveryResponse>

IndicesRecoveryResponse can be an empty query

refresh()

Makes a recent operation performed on one or more indices available for search.

Parameters
ParameterType
paramsIndicesRefreshParams
Returns

Promise<IndicesRefreshResponse>

IndicesRefreshResponse can be an empty query

stats()

Returns statistics for one or more indices

Parameters
ParameterType
paramsIndicesStats
Returns

Promise<IndicesStatsResponse>

IndicesStatsResponse

validateQuery()

Validates a query without executing it.

Parameters
ParameterType
paramsIndicesValidateQueryParams
Returns

Promise<IndicesValidateQueryResponse>

IndicesValidateQueryResponse

Source

elasticsearch-store/src/elasticsearch-client/client.ts:362


nodes

get nodes(): object

Returns

object

info()
Parameters
ParameterType
paramsNodesInfoParams
Returns

Promise<NodesInfoResponse>

stats()
Parameters
ParameterType
paramsNodesStatsParams
Returns

Promise<NodesStatsResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:160


tasks

get tasks(): object

Returns

object

cancel()

Cancels a currently running task

Parameters
ParameterType
paramsTasksCancelParams
Returns

Promise<TasksCancelResponse>

TasksCancelResponse

get()

Gets information about a running task

Parameters
ParameterType
paramsTasksGetParams
Returns

Promise<TasksGetResponse>

TasksGetResponse

list()

Returns information about the tasks currently executing in the cluster.

Parameters
ParameterType
paramsTasksListParams
Returns

Promise<TasksListResponse>

TasksListResponse

Source

elasticsearch-store/src/elasticsearch-client/client.ts:688

Methods

bulk()

bulk(params): Promise<BulkResponse>

Parameters

ParameterType
paramsBulkParams<unknown, unknown>

Returns

Promise<BulkResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:20


count()

count(params): Promise<CountResponse>

Gets the number of matches for a search query or if no query provided the count for docs in an index

Parameters

ParameterType
paramsCountParams

Returns

Promise<CountResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:90


create()

create(params): Promise<CreateResponse>

creates a new record, can throw if record already exists

Parameters

ParameterType
paramsCreateParams<unknown>

Returns

Promise<CreateResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:37


delete()

delete(params): Promise<DeleteResponse>

Deletes a specific record, requires an index and id.

Parameters

ParameterType
paramsDeleteParams

Returns

Promise<DeleteResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:199


deleteByQuery()

deleteByQuery(params): Promise<DeleteByQueryResponse>

Deletes documents that match the specified query.

Parameters

ParameterType
paramsDeleteByQueryParams

Returns

Promise<DeleteByQueryResponse>

count or Elasticsearch task_id

Source

elasticsearch-store/src/elasticsearch-client/client.ts:217


exists()

exists(params): Promise<boolean>

Check that the document id exists in the specified index.

Parameters

ParameterType
paramsExistsParams

Returns

Promise<boolean>

boolean

Source

elasticsearch-store/src/elasticsearch-client/client.ts:235


get()

get<T>(params): Promise<GetResponse<T>>

Retrieves the specified JSON document from an index or an empty doc if no doc id is found

Type parameters

Type parameterValue
TRecord<string, unknown>

Parameters

ParameterType
paramsGetParams

Returns

Promise<GetResponse<T>>

Object

Source

elasticsearch-store/src/elasticsearch-client/client.ts:253


index()

index(params): Promise<IndexResponse>

indexes a new record

Parameters

ParameterType
paramsIndexParams<unknown>

Returns

Promise<IndexResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:54


info()

info(): Promise<InfoResponse>

Returns info about the cluster the client is connected to

Returns

Promise<InfoResponse>

object with cluster info

Source

elasticsearch-store/src/elasticsearch-client/client.ts:270


mget()

mget(params): Promise<MGetResponse>

The multi get execution of multiple-get searches from a single API request

Parameters

ParameterType
paramsMGetParams

Returns

Promise<MGetResponse>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:331


msearch()

msearch(params): Promise<MSearchResponse<Record<string, unknown>>>

The multi search execution of several searches within the same API request

Parameters

ParameterType
paramsMSearchParams

Returns

Promise<MSearchResponse<Record<string, unknown>>>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:313


ping()

ping(): Promise<boolean>

Returns true or false based on whether the cluster is running.

Returns

Promise<boolean>

Boolean

Source

elasticsearch-store/src/elasticsearch-client/client.ts:282


reindex()

reindex(params): Promise<ReindexResponse>

Re-Index data to a new index

Parameters

ParameterType
paramsReindexParams

Returns

Promise<ReindexResponse>

Report of re-indexing task or task id if wait_for_completion is false

Source

elasticsearch-store/src/elasticsearch-client/client.ts:349


search<T>(params): Promise<SearchResponse<T>>

Returns search hits that match the query defined in the request.

Type parameters

Type parameterValue
TRecord<string, unknown>

Parameters

ParameterType
paramsSearchParams

Returns

Promise<SearchResponse<T>>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:295


update()

update(params): Promise<UpdateResponse<unknown>>

updates a record, or can upsert a record

Parameters

ParameterType
paramsUpdateParams<unknown, unknown>

Returns

Promise<UpdateResponse<unknown>>

Source

elasticsearch-store/src/elasticsearch-client/client.ts:71