elasticsearch-store / utils/elasticsearch
utils/elasticsearch
Type Aliases
FlattenProperties
FlattenProperties:
Record
<string
, [ESFieldType
,string
]>
This is the return type for getFlattenedNamesAndTypes
Source
elasticsearch-store/src/utils/elasticsearch.ts:240
Variables
__timeSeriesTest
const
__timeSeriesTest:object
={}
Type declaration
date?
optional
date:Date
Source
elasticsearch-store/src/utils/elasticsearch.ts:27
Functions
filterBulkRetries()
filterBulkRetries<
T
>(records
,result
):T
[]
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
records | T [] |
result | BulkResponse |
Returns
T
[]
Source
elasticsearch-store/src/utils/elasticsearch.ts:50
fixMappingRequest()
fixMappingRequest(
client
,_params
,isTemplate
):any
Parameters
Parameter | Type |
---|---|
client | Client |
_params | object |
_params.body | ESMapping |
_params.index ? | string |
_params.name ? | string |
isTemplate | boolean |
Returns
any
Source
elasticsearch-store/src/utils/elasticsearch.ts:180
getBulkResponseItem()
getBulkResponseItem(
input
):BulkResponseItemResult
Get the first key and value from the bulk response:
Here is an example input:
{
"index": {
"_index": "test",
"_type": "type1",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true,
"status": 201
}
}
Parameters
Parameter | Type |
---|---|
input | any |
Returns
BulkResponseItemResult
Source
elasticsearch-store/src/utils/elasticsearch.ts:112
getClientMetadata()
getClientMetadata(
client
):ClientMetadata
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
ClientMetadata
Source
elasticsearch-store/src/utils/elasticsearch.ts:131
getESVersion()
getESVersion(
client
):number
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
number
Source
elasticsearch-store/src/utils/elasticsearch.ts:119
getFlattenedNamesAndTypes()
getFlattenedNamesAndTypes(
config
):FlattenProperties
This is useful for diffing the property mappings, the keys should be sorted so this can be stringified and diffed.
Parameters
Parameter | Type |
---|---|
config | ESTypeMapping |
Returns
Source
elasticsearch-store/src/utils/elasticsearch.ts:246
getTimeByField()
getTimeByField(
field
): (input
) =>number
Parameters
Parameter | Type | Default value |
---|---|---|
field | string | '' |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | any |
Returns
number
Source
elasticsearch-store/src/utils/elasticsearch.ts:13
isElasticsearch6()
isElasticsearch6(
client
):boolean
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
boolean
Source
elasticsearch-store/src/utils/elasticsearch.ts:146
isElasticsearch8()
isElasticsearch8(
client
):boolean
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
boolean
Source
elasticsearch-store/src/utils/elasticsearch.ts:153
isOpensearch()
isOpensearch(
client
):boolean
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
boolean
Source
elasticsearch-store/src/utils/elasticsearch.ts:160
isOpensearch1()
isOpensearch1(
client
):boolean
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
boolean
Source
elasticsearch-store/src/utils/elasticsearch.ts:165
isOpensearch2()
isOpensearch2(
client
):boolean
Parameters
Parameter | Type |
---|---|
client | Client |
Returns
boolean
Source
elasticsearch-store/src/utils/elasticsearch.ts:172
shardsPath()
shardsPath(
index
): (stats
) =>Shard
[]
Parameters
Parameter | Type |
---|---|
index | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
stats | any |
Returns
Shard
[]
Source
elasticsearch-store/src/utils/elasticsearch.ts:17
timeSeriesIndex()
timeSeriesIndex(
index
,timeSeriesFormat
):string
Parameters
Parameter | Type | Default value |
---|---|---|
index | string | undefined |
timeSeriesFormat | TimeSeriesFormat | 'monthly' |
Returns
string
Source
elasticsearch-store/src/utils/elasticsearch.ts:34
verifyIndexShards()
verifyIndexShards(
shards
):boolean
Parameters
Parameter | Type |
---|---|
shards | Shard [] |
Returns
boolean