hsen-dev/vscode-elastic

Get Payload from File

rawkode opened this issue · 2 comments

Hey, awesome work on this.

I was wondering how difficult it would be to allow the following:

PUT /my-index
!./opt/elasticsearch/mapping.json

Where !./path will load the contents of a file and use that as the body payload?

Thank you very much if you add its documentation on README.md.

POST /example/_bulk
{"index":{}}
{"nps_link":"https://www.nps.gov/wrst/index.htm","title":"Wrangell–St. Elias","date_established":"1980-12-02T06:00:00+00:00","world_heritage_site":"true","states":["Alaska"],"description":"An over 8 million acres (32,375 km2) plot of mountainous country—the largest National Park","visitors":79047,"id":"park_wrangell–st.-elias","location":"61,-142","square_km":33682.6,"acres":8323146.48}

I load data from 1.json,but vscode-elastic report Invalid json

{"index":{}}
{"nps_link":"https://www.nps.gov/wrst/index.htm","title":"Wrangell–St. Elias","date_established":"1980-12-02T06:00:00+00:00","world_heritage_site":"true","states":["Alaska"],"description":"An over 8 million acres (32,375 km2) plot of mountainous country—the largest National Park","visitors":79047,"id":"park_wrangell–st.-elias","location":"61,-142","square_km":33682.6,"acres":8323146.48}