ElasticSearch illegal_argument_exception for client.bulk() Node.js

938 Views Asked by At

I try to send data to ES and I was using POST request to send data line by line and it worked fine with small files.

When I changed to use client.bulk(), I keep getting the following error message:

"status": 400,
"error":
{
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [target_status_code]",
    "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "For input string: \"-\""
    }
}

I noticed that after I use bulk, the type of target_status_code field has changed from string to number and many keyord fields are gone.

I only modified the sending request function so I don't understand why it doesn't work when using bulk.

0

There are 0 best solutions below