[gdal-dev] Question about how GDAL makes an ElasticSearch index

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Wed Nov 23 04:58:56 PST 2016


Hi,

It seems that all examples about how to query ElasticSearch with GDAL in http://www.gdal.org/drv_elasticsearch.html are failing with ElasticSearch versions 2.x.
Reason is the breaking change "A field can no longer be referenced using its short name. Instead, the full path to the field is required" as documented in
https://www.elastic.co/guide/en/elasticsearch/reference/2.0/breaking_20_mapping_changes.html

I am planning to update the documents but I would like to be sure that I have understood it right that:

-          GDAL creates an ElasticSearch index with the name = OGR layer name

-          That ES index has always _type named FeatureCollection

-          attributes of the source data are always within "properties"

Therefore this
ogrinfo -ro ES: my_type -where '{ "filter": { "term": { "EAS_ID": 168 } } }'

must be used in this way with ES 2.x
ogrinfo -ro ES: my_type -where '{ "filter": { "term": { "properties.EAS_ID": 168 } } }'

similarly the Windows escaping example
C:\GDAL_on_Windows>ogrinfo ES: my_type -where "{\"query\": { \"match\": { \"properties.NAME\": \"Helsinki\" } } }"

Do you agree?

-Jukka Rahkonen-



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161123/64592bb9/attachment-0001.html>


More information about the gdal-dev mailing list