【发布时间】:2023-02-07 14:24:51
【问题描述】:
我正在使用 node.js Elasticsearch 7.17 客户端创建默认索引设置,我希望 total_fields limit 超过默认的 1000。当我尝试以下操作时:
export const defaultCaseIndexSettings: IndicesIndexSettings = {
'index.number_of_replicas': 0,
'index.number_of_shards': 6,
'index.max_result_window': Number(INDEX_MAX_RESULT_WINDOW),
'index.mapping.total_fields.limit': 10000,
etc.
}
index.mapping.total_fields.limit好像不是可以在IndicesIndexSettings上设置的设置。我也试过:
export const defaultCaseSettingsIndexConfig: IndicesCreateRequest['body'] = {
settings: {
index: {
number_of_shards: '2',
number_of_replicas: '2',
mapping: {
total_fields: {
limit: 10000,
},
},
},
},
这给了我 Object literal may only specify known properties, and 'mapping' does not exist in type 'IndicesIndexSettings'. 如何使用 nodejs Elasticsearch 客户端设置 total_fields 限制?
【问题讨论】:
标签: javascript node.js elasticsearch indexing