【问题标题】:unknown field [dest], parser not found- error coming while reindexing未知字段 [dest],未找到解析器 - 重新索引时出现错误
【发布时间】:2019-04-03 05:39:09
【问题描述】:

使用以下代码进行索引时,由于未找到未知字段解析器而出现错误:

client.reindex({

         body: {
            script: {
               source: {
                  index: index,
                  type: "_doc",
                  query: {
                     term: {
                        id: id
                     }
                  }
               },
               dest: {
                  index: dest_ind
               }
            }
         }
      }

【问题讨论】:

  • dest 属性应在script 之外。

标签: javascript node.js elasticsearch reindex


【解决方案1】:

将dest 放在外面,而不是嵌套在script - https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

client.reindex({
    body: {
          source: {
             index: index,
             type: "_doc",
             query: {
                term: {
                   id: id
                }
             }
       },
       dest: {
            index: dest_ind
        }
    }
 })

【讨论】:

  • 是的,但是又出现了一些验证错误。我删除了脚本字段,其余代码保持原样。现在似乎可以工作了。
  • @A.Code.Ran - 我对reindex 不是很熟悉,但错误是关于编译器不知道dest 是什么。所以后来我签入了documentation。
猜你喜欢
  • 2013-02-14
  • 2019-07-23
  • 1970-01-01
  • 2016-12-29
  • 1970-01-01
  • 2017-10-14
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
相关资源
最近更新 更多