How can I use the Elasticsearch API APIs to get the index configuration in json format correctly encoded?
I tried to request the admin.indices client using GetMappingRequest. However, the display format always has strange characters - I tried ISO8559, ASCII, UTF-8, UTF-16:
val bs = new ByteArrayOutputStream()
client.admin.indices.getMappings(new GetMappingsRequest()).get.writeTo(new OutputStreamStreamOutput(bs))
val mapping = new String(bs.toByteArray, CharSet.UTF8)
println(mapping)
Answer:
{"_all@enabled":false},"_tt tru ype@1
index":"no" . properties@valu`$ ,"string", 4}}}dateOptionalTimeoffers42c9e293decoratedOfferd
source
share