Compressor detection can only be called on some xcontent bytes

I'm trying to send data to elasticsearch but running into the error:

Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes

Here is my data:

[ {
  "data" : "119050300",
  "date" : "00:00 2019-06-03"
}, {
  "data" : "119050301",
  "date" : "01:00 2019-06-03"
}, {
  "data" : "119050302",
  "date" : "02:00 2019-06-03"
}, {
  "data" : "119050303",
  "date" : "03:00 2019-06-03"
}, {
  "data" : "119050304",
  "date" : "04:00 2019-06-03"
}, {
  "data" : "119050305",
  "date" : "05:00 2019-06-03"
}, {
  "data" : "119050306",
  "date" : "06:00 2019-06-03"
}, {
  "data" : "119050307",
  "date" : "07:00 2019-06-03"
}, {
  "data" : "119050308",
  "date" : "08:00 2019-06-03"
}, {
  "data" : "119050309",
  "date" : "09:00 2019-06-03"
}, {
  "data" : "119050310",
  "date" : "10:00 2019-06-03"
}, {
  "data" : "119050311",
  "date" : "11:00 2019-06-03"
}, {
  "data" : "119050312",
  "date" : "12:00 2019-06-03"
}, {
  "data" : "119050313",
  "date" : "13:00 2019-06-03"
}, {
  "data" : "119050314",
  "date" : "14:00 2019-06-03"
}, {
  "data" : "119050315",
  "date" : "15:00 2019-06-03"
}, {
  "data" : "119050923",
  "date" : "23:00 2019-06-09"
} ]

Im using a PUT command with this in the body and hitting URL:

 http://....com:5101/core/doc/1

You seem to be trying to send a bare JSON array to Elasticsearch, but Elasticsearch expects to receive JSON objects instead. If you want this to be indexed as a single document, you should wrap it in an object:

{"values":[{"data":"119050300","date":"00:00 2019-06-03"},...

If you want each object in your array to be a separate document, you are probably looking for the bulk indexing API instead.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.