Package org.elasticsearch.action.admin.indices.create

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexRequest.mapping()


                    }
                    if (source.containsKey("mappings")) {
                        found = true;
                        Map<String, Object> mappings = (Map<String, Object>) source.get("mappings");
                        for (Map.Entry<String, Object> entry : mappings.entrySet()) {
                            createIndexRequest.mapping(entry.getKey(), (Map<String, Object>) entry.getValue());
                        }
                    }
                    if (!found) {
                        // the top level are settings, use them
                        createIndexRequest.settings(source);
View Full Code Here


        CreateIndexRequest createReq;
       
        if(type.equals("*")) {
            createReq = new CreateIndexRequest(newIndex);
            for(ObjectObjectCursor<String, MappingMetaData> mapCursor : indexData.mappings()) {
                createReq.mapping(mapCursor.key, mapCursor.value.sourceAsMap());
            }
            createReq.settings(settingBuilder.build());
        }
        else {
            MappingMetaData mappingMeta = indexData.mapping(type);
View Full Code Here

          String sCachePolicy = properties.getElasticCachePolicy();
          if (null != sCachePolicy) {
            settings.put("index.cache.field.type", sCachePolicy);
          }
          if (null != sMapping) {
            cir.mapping(_sIndexType, sMapping);
          }
          cir.settings(settings.build());
          _elasticClient.admin().indices().create(cir).actionGet();
         
          //(Wait for above operation to be completed)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.