【发布时间】:2021-05-02 00:25:38
【问题描述】:
我在弹性搜索中有 2 个索引具有相同的别名,但仅针对其中一个,is_write_index 为真。现在,当我尝试按别名写入索引时,出现以下错误:
Alias [alias_name] has more than one indices associated with it [[indexname1, indexname2]], can't execute a single index op
这是我正在做但失败的事情:
let doc = {
script: {
source: ...,
lang: "painless",
params: {
...document
}
},
upsert: {
...document
}
};
await client.update({
index: alias_name,
id: docId,
body: doc
});
这可能是什么问题?我的想法是,如果只有其中一个被标记为写入索引,它只会写入该索引并且写入不应该失败(https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html#aliases-write-index)。我理解错了吗?
【问题讨论】:
-
你能说明你要做什么操作吗?
-
我正在使用 Node JS 代码中的 elasticsearch 更新 API:elastic.co/guide/en/elasticsearch/client/javascript-api/current/…
-
展示自己在做什么会更容易
-
感谢您的回复。我更新了问题。希望对您有所帮助。
标签: elasticsearch