Elasticsearch Store: `Elasticsearch Client Client Client`
elasticsearch-client/client.Client
Table of contents
Constructors
Accessors
Methods
- bulk
- count
- create
- delete
- deleteByQuery
- exists
- get
- index
- info
- mget
- msearch
- ping
- reindex
- search
- update
Constructors
constructor
• new Client(client
, distributionMeta
): Client
Parameters
Name | Type |
---|---|
client | any |
distributionMeta | ClientMetadata |
Returns
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:8
Accessors
__meta
• get
__meta(): ClientMetadata
Returns
ClientMetadata
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:16
cat
• get
cat(): Object
Returns
Object
Name | Type |
---|---|
indices | (params : CatIndicesParams ) => Promise <CatIndicesResponse > |
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:137
cluster
• get
cluster(): Object
Returns
Object
Name | Type |
---|---|
getSettings | (params : ClusterGetSettingsParams ) => Promise <ClusterGetSettingsResponse > |
health | (params : ClusterHealthParams ) => Promise <ClusterHealthResponse > |
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:103
indices
• get
indices(): Object
Returns
Object
Name | Type |
---|---|
create | (params : IndicesCreateParams ) => Promise <IndicesCreateResponse > |
delete | (params : IndicesDeleteParams ) => Promise <IndicesDeleteResponse > |
deleteTemplate | (params : IndicesDeleteTemplateParams ) => Promise <IndicesDeleteTemplateResponse > |
exists | (params : IndicesExistsParams ) => Promise <boolean > |
existsTemplate | (params : IndicesExistsTemplateParams ) => Promise <boolean > |
get | (params : IndicesGetParams ) => Promise <IndicesGetResponse > |
getFieldMapping | (params : IndicesGetFieldMappingParams ) => Promise <IndicesGetFieldMappingResponse > |
getIndexTemplate | (params : IndicesGetIndexTemplateParams ) => Promise <IndicesGetIndexTemplateResponse > |
getMapping | (params : IndicesGetMappingParams ) => Promise <IndicesGetMappingResponse > |
getSettings | (params : IndicesGetSettingsParams ) => Promise <IndicesGetSettingsResponse > |
getTemplate | (params : IndicesGetTemplateParams ) => Promise <IndicesGetTemplateResponse > |
putMapping | (params : IndicesPutMappingParams ) => Promise <IndicesPutMappingResponse > |
putSettings | (params : IndicesPutSettingsParams ) => Promise <IndicesPutSettingsResponse > |
putTemplate | (params : IndicesPutTemplateParams ) => Promise <IndicesPutTemplateResponse > |
recovery | (params : IndicesRecoveryParams ) => Promise <IndicesRecoveryResponse > |
refresh | (params : IndicesRefreshParams ) => Promise <IndicesRefreshResponse > |
stats | (params : IndicesStats ) => Promise <IndicesStatsResponse > |
validateQuery | (params : IndicesValidateQueryParams ) => Promise <IndicesValidateQueryResponse > |
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:362
nodes
• get
nodes(): Object
Returns
Object
Name | Type |
---|---|
info | (params : NodesInfoParams ) => Promise <NodesInfoResponse > |
stats | (params : NodesStatsParams ) => Promise <NodesStatsResponse > |
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:160
tasks
• get
tasks(): Object
Returns
Object
Name | Type |
---|---|
cancel | (params : TasksCancelParams ) => Promise <TasksCancelResponse > |
get | (params : TasksGetParams ) => Promise <TasksGetResponse > |
list | (params : TasksListParams ) => Promise <TasksListResponse > |
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:688
Methods
bulk
▸ bulk(params
): Promise
<BulkResponse
>
Parameters
Name | Type |
---|---|
params | BulkParams <unknown , unknown > |
Returns
Promise
<BulkResponse
>
Defined in
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
Name | Type |
---|---|
params | CountParams |
Returns
Promise
<CountResponse
>
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:90
create
▸ create(params
): Promise
<CreateResponse
>
creates a new record, can throw if record already exists
Parameters
Name | Type |
---|---|
params | CreateParams <unknown > |
Returns
Promise
<CreateResponse
>
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:37
delete
▸ delete(params
): Promise
<DeleteResponse
>
Deletes a specific record, requires an index and id.
Parameters
Name | Type |
---|---|
params | DeleteParams |
Returns
Promise
<DeleteResponse
>
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:199
deleteByQuery
▸ deleteByQuery(params
): Promise
<DeleteByQueryResponse
>
Deletes documents that match the specified query.
Parameters
Name | Type |
---|---|
params | DeleteByQueryParams |
Returns
Promise
<DeleteByQueryResponse
>
count or Elasticsearch task_id
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:217
exists
▸ exists(params
): Promise
<boolean
>
Check that the document id exists in the specified index.
Parameters
Name | Type |
---|---|
params | ExistsParams |
Returns
Promise
<boolean
>
boolean
Defined in
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
Name | Type |
---|---|
T | Record <string , unknown > |
Parameters
Name | Type |
---|---|
params | GetParams |
Returns
Promise
<GetResponse
<T
>>
Object
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:253
index
▸ index(params
): Promise
<IndexResponse
>
indexes a new record
Parameters
Name | Type |
---|---|
params | IndexParams <unknown > |
Returns
Promise
<IndexResponse
>
Defined in
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
Defined in
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
Name | Type |
---|---|
params | MGetParams |
Returns
Promise
<MGetResponse
>
Array of Record<string, any>
Defined in
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
Name | Type |
---|---|
params | MSearchParams |
Returns
Promise
<MSearchResponse
<Record
<string
, unknown
>>>
Array of Record<string, any>
Defined in
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
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:282
reindex
▸ reindex(params
): Promise
<ReindexResponse
>
Re-Index data to a new index
Parameters
Name | Type |
---|---|
params | ReindexParams |
Returns
Promise
<ReindexResponse
>
Report of re-indexing task or task id if wait_for_completion is false
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:349
search
▸ search<T
>(params
): Promise
<SearchResponse
<T
>>
Returns search hits that match the query defined in the request.
Type parameters
Name | Type |
---|---|
T | Record <string , unknown > |
Parameters
Name | Type |
---|---|
params | SearchParams |
Returns
Promise
<SearchResponse
<T
>>
Array of Record<string, any>
Defined in
elasticsearch-store/src/elasticsearch-client/client.ts:295
update
▸ update(params
): Promise
<UpdateResponse
<unknown
>>
updates a record, or can upsert a record
Parameters
Name | Type |
---|---|
params | UpdateParams <unknown , unknown > |
Returns
Promise
<UpdateResponse
<unknown
>>