【问题标题】:Elasticsearch nodejs - No index foundElasticsearch nodejs - 找不到索引
【发布时间】:2021-10-31 12:56:42
【问题描述】:

我在 heroku 上使用 npm elasticsearch 和盆景,并在下面不断收到此错误:

    statusCode: 404,
  response: `{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [question] and [action.auto_create_index] ([*logstash*,*requests*,*events*,*.kibana*,*kibana-int*,*filebeat*,.watches,.triggered_watches,.watcher-history-*]) doesn't match","index_uuid":"_na_","index":"question"}],"type":"index_not_found_exception","reason":"no such index [question] and [action.auto_create_index] ([*logstash*,*requests*,*events*,*.kibana*,*kibana-int*,*filebeat*,.watches,.triggered_watches,.watcher-history-*]) doesn't match","index_uuid":"_na_","index":"question"},"status":404}`,

这是我正在使用的代码,目前没有文档。

client.index({
                    index: 'question',
                    id: question_id,
                    type: 'questions',
                    body: {
                        "title": title,
                        "tags": tags
                    }
                }, function(err, resp, status) {

我的假设是如果索引不存在就不会创建它,但我认为它是默认自动创建的?

任何帮助将不胜感激。

【问题讨论】:

    标签: node.js elasticsearch heroku


    【解决方案1】:

    是因为这部分的错误;

    no such index [question] and [action.auto_create_index] ([*logstash*,*requests*,*events*,*.kibana*,*kibana-int*,*filebeat*,.watches,.triggered_watches,.watcher-history-*]) doesn't match

    它告诉您您的索引名称与允许的可自动创建的索引模式名称集不匹配。请查看https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation 了解更多信息

    【讨论】:

    • 感谢您的回复,但不确定我是否理解索引模式有什么问题,因为这适用于我的 AWS elasticsearch db,但在尝试使用 heroku bonsai 时,我开始收到此错误...能详细点吗?
    • 我不知道盆景服务是如何工作的,但是您需要更改我链接到的设置
    猜你喜欢
    • 2012-04-07
    • 1970-01-01
    • 2021-08-11
    • 1970-01-01
    • 2020-01-24
    • 2012-12-12
    • 1970-01-01
    • 2015-11-03
    • 1970-01-01
    相关资源
    最近更新 更多