Ingest shapefile into Elasticsearch with GDAL

I am trying to index shapefile into Elasticsearch. The geometry type is Multipolygon.

By following this blog post

I try this cmd:

ogr2ogr -lco INDEX_NAME=test -lco NOT_ANALYZED_FIELDS={ALL} ES:http://localhost:9200 test.shp

However, I have got below errors.

ERROR 1: HTTP error code : 406

ERROR 1: {"error":"Content-Type header [application/x-javascript; charset=UTF-8] is not supported","status":406}

ERROR 1: Unable to write feature 0 from layer test.

ERROR 1: Terminating translation prematurely after failed

translation of layer test (use -skipfailures to skip errors)

Can anyone help on this?


Hi @Scorpion21. Which version of elasticsearch and which version of GDAL are you using?

The GDAL version can be found by running ogrinfo --version.

GDAL 2.3.3
Elasticsearch 7.6.2

Hi @Scorpion21. GDAL 2.3.3 is not compatible with Elasticsearch 7+. You'll want to install GDAL 3.1.0.

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