Elasticsearch: Añadiendo mapeo manual usando Java

No puedo cambiar el mapeo. ¿Alguien puede ayudarme a encontrar el error en mi código?
He encontrado esta forma estándar de cambiar la asignación de acuerdo con varios tutoriales. Pero cuando intento llamar a la estructura de mapeo, aparece una estructura de mapeo en blanco después de la creación del mapeo manual.
Pero después de insertar algunos datos, aparece la especificación de mapeo porque ES está utilizando, por supuesto, la predeterminada. Para ser más específicos ver el código a continuación.

public class ElasticTest {
private String dbname = "ElasticSearch";
private String index = "indextest";
private String type = "table";
private Client client = null;
private Node node = null;

public ElasticTest(){
    this.node = nodeBuilder().local(true).node();
    this.client = node.client();

    if(isIndexExist(index)){
        deleteIndex(this.client, index);
        createIndex(index);
    }
    else{
        createIndex(index);
    }

    System.out.println("mapping structure before data insertion");
    getMappings();
    System.out.println("----------------------------------------");
    createData();
    System.out.println("mapping structure after data insertion");
    getMappings();



}

public void getMappings() {
    ClusterState clusterState = client.admin().cluster().prepareState()
            .setFilterIndices(index).execute().actionGet().getState();
    IndexMetaData inMetaData = clusterState.getMetaData().index(index);
    MappingMetaData metad = inMetaData.mapping(type);

    if (metad != null) {
        try {
            String structure = metad.getSourceAsMap().toString();
            System.out.println(structure);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}

private void createIndex(String index) {
    XContentBuilder typemapping = buildJsonMappings();
    String mappingstring = null;
    try {
        mappingstring = buildJsonMappings().string();
    } catch (IOException e1) {
        e1.printStackTrace();
    }

    client.admin().indices().create(new CreateIndexRequest(index)
                  .mapping(type, typemapping)).actionGet();

    //try put mapping after index creation
    /*
     * PutMappingResponse response = null; try { response =
     * client.admin().indices() .preparePutMapping(index) .setType(type)
     * .setSource(typemapping.string()) .execute().actionGet(); } catch
     * (ElasticSearchException e) { e.printStackTrace(); } catch
     * (IOException e) { e.printStackTrace(); }
     */

}

private void deleteIndex(Client client, String index) {
    try {
        DeleteIndexResponse delete = client.admin().indices()
                .delete(new DeleteIndexRequest(index)).actionGet();
        if (!delete.isAcknowledged()) {
        } else {
        }
    } catch (Exception e) {
    }
}

private XContentBuilder buildJsonMappings(){
    XContentBuilder builder = null; 
    try {
        builder = XContentFactory.jsonBuilder();
        builder.startObject()
        .startObject("properties")
            .startObject("ATTR1")
                .field("type", "string")
                .field("store", "yes")
                .field("index", "analyzed")
             .endObject()
           .endObject()
        .endObject();           
    } catch (IOException e) {
        e.printStackTrace();
    }
    return builder;
}

private boolean isIndexExist(String index) {
    ActionFuture<IndicesExistsResponse> exists = client.admin().indices()
            .exists(new IndicesExistsRequest(index));
    IndicesExistsResponse actionGet = exists.actionGet();

    return actionGet.isExists();
}

private void createData(){
    System.out.println("Data creation");
    IndexResponse response=null;
    for (int i=0;i<10;i++){
        Map<String, Object> json = new HashMap<String, Object>();
        json.put("ATTR1", "new value" + i);
        response = this.client.prepareIndex(index, type)
                .setSource(json)
                .setOperationThreaded(false)
                .execute()
                .actionGet();
    }
    String _index = response.getIndex();
    String _type = response.getType();
    long _version = response.getVersion();
    System.out.println("Index : "+_index+"   Type : "+_type+"   Version : "+_version);
    System.out.println("----------------------------------");
}

public static void main(String[] args)
{
    new ElasticTest();
}
}

Solo quiero cambiar la propiedad del campo ATTR1 a analizada para asegurar consultas rápidas. ¿Qué estoy haciendo mal? También intenté crear la asignación después de la creación del índice, pero conduce al mismo efecto.

Respuestas a la pregunta(1)

Su respuesta a la pregunta