Closed lubbo closed 5 years ago
@lubbo Please include ElasticSwift
and Elasticsearch
versions you are using. The current version of ElasticSwift is tested against es-6.2.x
I’m using 7.0, 6.8 still have this format as per official docs: https://www.elastic.co/guide/en/elasticsearch/reference/6.8/indices-get-index.html
Maybe that is changed in 6.8
In the GetIndexRequest method
func responseHandler(_ response: ESResponse) -> Void
deserializing the response inlet decoded: GetIndexResponse? = try Serializers.decode(data: response.data!)
always throw ankeyNotFound
exception.This because it expect to find a
GetIndexResponse
object in the JSON result with following attributes:instead ElasticSearch JSON wraps this object inside an attribute with the name of the index retrieved.
Expected JSON:
{"aliases":{},"mappings":{},"settings":{"index":{"creation_date":"1559206573432","number_of_shards":"1","number_of_replicas":"1","uuid":"I6Ep6P6FQI2wplQCckfr6Q","version":{"created":"7000199"},"provided_name":"test"}}}
Actual JSON:
{"test":
{"aliases":{},"mappings":{},"settings":{"index":{"creation_date":"1559206573432","number_of_shards":"1","number_of_replicas":"1","uuid":"I6Ep6P6FQI2wplQCckfr6Q","version":{"created":"7000199"},"provided_name":"test"}}}
}