Search code examples
javascriptnode.jselasticsearchreindex

unknown field [dest], parser not found- error coming while reindexing


While indexing with the following code, error arises as unknown field parser not found:

client.reindex({

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

Solution

  • Place dest outside and not nested in 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
            }
        }
     })