Search code examples
searchbulkelasticsearch-plugin

elastic search _bulk request with "head" plugin


I've an elastic search cluster with "elasticsearch-head" plugin installed properly.

I want to use the _bulk API to insert several values at once but the specific format of _bulk request body seems to be causing troubles to the plugin.

I use the "Any query" panel to specify my request with the following setup:
query: /_bulk
body:

{ "create" : { "_index" : "eco", "_type" : "usage" } }
{ "index": 1, name" : "my_value" }

I get the following when validating the json and the request won't be executed:

JSON.parse: unexpected non-whitespace character after JSON data at line 2 column 1 of the JSON data

Does anyone knows if elasticsearch-head plugin can handle the _bulk API ? Or is there something wrong with my request ?


Solution

  • You are missing the quotes before name.

    { "index": 1, "name" : "my_value" }