小编典典

未知字段[目标],未找到解析器-重新索引时出现错误

elasticsearch

使用以下代码建立索引时,由于找不到未知字段解析器而产生错误:

client.reindex({

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

阅读 333

收藏
2020-06-22

共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
        }
    }
 })
2020-06-22