Closed marcust closed 9 years ago
@marcust , I think this has already been fixed in 2.1.0-SNAPSHOT: https://github.com/englishtown/vertx-elasticsearch-service/blob/develop/src/main/java/com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService.java#L79
Yes, that seems to be the same thing.
JsonObject.getMap returns the original map from inside JsonObject. Deep nested objects are contained there as JsonObject Objects which implements Iterable of Map.Entry. IndexRequestBuilder.setSource(Map) uses XContentBuilder to transform the objects it gets. For an Iterable it creates an array of the items, in thatcase their toString value. This basically destroys indexing of nested object with the module, becuase the become an array of "key=value" Strings.
This patch changes the "getMap" to "encode" in order to hand the actual json to Elasticsearch.