1

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
               }
            }
         }
      }
adiga
  • 34,372
  • 9
  • 61
  • 83
A.Code.Ran
  • 77
  • 1
  • 9

1 Answers1

2

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
        }
    }
 })
A.Code.Ran
  • 77
  • 1
  • 9
random
  • 7,756
  • 3
  • 19
  • 25
  • Yes, but again Some validation error was arising. I removed the script field and rest of the code was as it is. Seems to be working now. – A.Code.Ran Apr 03 '19 at 06:06
  • @A.Code.Ran - I am not really familiar with `reindex`, but the error was about compiler did not knew what is `dest`. So later I checked in the `documentation`. – random Apr 03 '19 at 06:30