GetMappingsRequest getRequest = new GetMappingsRequest().indices("indexname");GetMappingsResponse cs = client.admin().indices().getMappings(getRequest).get();ImmutableOpenMap<String, MappingmetaData> mappingStr = cs.mappings().get("indexname");for (ObjectObjectCursor<String, MappingmetaData> c : mappingStr) { Map m = (Map) c.value.getSourceAsMap().get("_parent"); if (m != null) { if (typeName.equals(m.get("type"))) types.add(c.key); }}if(types.size>0){ return true;}else{ return false;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)