parse_exception - request-body wird benötigt

Ich versuche, fügen Sie ein JSON Daten-Datei in meinem elasticsearch Instanz.

curl -s -H “Content-Type: application/x-ndjson” -XPOST localhost:9200/_bulk —-data-binary “@restaurants.json”; echo

Jedoch, nach ausführen dieses Befehls bekomme ich eine Fehlermeldung, die sagt

{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}

Die JSON-Datei hat im Grunde ein array mit den unter der Objekt.
Nur die Sache ist, ich habe gerade einen Gegenstand hier, um Speicherplatz zu sparen. Es gibt jedoch mehr als eine Objekte präsentieren.

Struktur ist wie unten angegeben;

[
   {
      "address": {
         "building": "351",
         "coord": [
            -73.98513559999999,
            40.7676919
         ],
         "street": "West   57 Street",
         "zipcode": "10019"
      },
      "borough": "Manhattan",
      "cuisine": "Irish",
      "name": "Dj Reynolds Pub And Restaurant",
      "grades": [
         {
            "date": {
               "$date": "2014-09-06T00:00:00.000Z"
            },
            "grade": "A",
            "score": 2
         },
         {
            "date": {
               "$date": "2013-07-22T00:00:00.000Z"
            },
            "grade": "A",
            "score": 11
         },
         {
            "date": {
               "$date": "2012-07-31T00:00:00.000Z"
            },
            "grade": "A",
            "score": 12
         },
         {
            "date": {
               "$date": "2011-12-29T00:00:00.000Z"
            },
            "grade": "A",
            "score": 12
         }
      ],
      "id": "30191841"
   }
]
Diese Antwort kann helfen: stackoverflow.com/questions/33340153/...

InformationsquelleAutor Vivek Malhotra | 2018-01-06

Schreibe einen Kommentar