ngageoint / elasticgeo

ElasticGeo provides a GeoTools data store that allows geospatial features from an Elasticsearch index to be published via OGC services using GeoServer.
GNU General Public License v3.0
169 stars 85 forks source link

fixes #33 #34

Closed nreese closed 7 years ago

nreese commented 7 years ago

Updates mil.nga.giat.data.elasticsearch.ElasticCompat5 isAnalyzed method to support new 5.x conventions.

Elasticsearch 5.x changed how analyzed fields are defined. In 2.x, the field index was set to analyzed or not_ analyzed. In 5.x, the field type is set to keyword or text.

The method now has to check to see if the value pulled from the map is itself a map. The reason for this is that there is a naming collision for the key type. At the top level, it is the key for a property. At the property level, it is a key for the field type. mil.nga.giat.data.elasticsearch.ElasticDataStore Line 312 causes the problems that are avoided with the extra if statement

else if (key.equals("type") && !value.equals("nested")) {
    add(elasticAttributes, propertyKey, (String) value, map, nested);
}