如何使用Elasticsearch Java API以正确编码的json格式获取索引的配置?
我尝试使用GetMappingRequest查询admin.indices客户端。但是映射的格式总是有奇怪的字符 - 我尝试过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)
响应:
{"_all@enabled":false},"_tt�tru�ype@1
index":"no" . properties@valu`$�,"string",�4}}}dateOptionalTimeoffers42c9e293decoratedOfferd