Examples of mapping()


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

          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

Examples of org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest.mapping()

                Map<String, Object> mappings = (Map<String, Object>) source.get("mappings");
                for (Map.Entry<String, Object> entry : mappings.entrySet()) {
                    if (!(entry.getValue() instanceof Map)) {
                        throw new ElasticSearchIllegalArgumentException("Malformed mappings section for type [" + entry.getKey() + "], should include an inner object describing the mapping");
                    }
                    putRequest.mapping(entry.getKey(), (Map<String, Object>) entry.getValue());
                }
            }
        } catch (Exception e) {
            try {
                channel.sendResponse(new XContentThrowableRestResponse(request, e));
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

                    final IndexMetaData indexMetaData = currentState.metaData().index(index);
                    if (indexMetaData == null) {
                        // index got delete on us, ignore...
                        return currentState;
                    }
                    if (indexMetaData.mappings().containsKey(type) && indexMetaData.mapping(type).source().equals(mappingSource)) {
                        return currentState;
                    }

                    IndexService indexService = indicesService.indexService(index);
                    if (indexService == null) {
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

                        // merge from the updated into the existing, ignore conflicts (we know we have them, we just want the new ones)
                        existingMapper.merge(updatedMapper, mergeFlags().simulate(false));
                    }

                    // if we end up with the same mapping as the original once, ignore
                    if (indexMetaData.mappings().containsKey(type) && indexMetaData.mapping(type).source().equals(existingMapper.mappingSource())) {
                        return currentState;
                    }

                    // build the updated mapping source
                    if (logger.isDebugEnabled()) {
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

                .execute().actionGet();

        assertThat(clusterStateResponse.getState().getMetaData().getIndices().containsKey(indexWithDate), is(true));
        IndexMetaData indexMetaData = clusterStateResponse.getState().getMetaData().getIndices().get(indexWithDate);
        assertThat(indexMetaData.getMappings().containsKey("counter"), is(true));
        Map<String, Object> properties = getAsMap(indexMetaData.mapping("counter").sourceAsMap(), "properties");
        Map<String, Object> mapping = getAsMap(properties, "name");
        assertThat(mapping, hasKey("index"));
        assertThat(mapping.get("index").toString(), is("not_analyzed"));
    }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

        ClusterState cs = client.admin().cluster().prepareState().setIndices(index).execute().actionGet().getState();
        IndexMetaData imd = cs.getMetaData().index(index);

        if (imd == null) return false;

        MappingMetaData mdd = imd.mapping(type);

        if (mdd != null) return true;
        return false;
    }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

                createReq.mapping(mapCursor.key, mapCursor.value.sourceAsMap());
            }
            createReq.settings(settingBuilder.build());
        }
        else {
            MappingMetaData mappingMeta = indexData.mapping(type);
            createReq = new CreateIndexRequest(newIndex).
                mapping(type, mappingMeta.sourceAsMap()).
                settings(settingBuilder.build());
        }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

            // If there is no index, there is no mapping either
        }

        if (imd == null) return false;

    MappingMetaData mdd = imd.mapping(type);

    if (mdd != null) return true;
    return false;
  }
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

            // If there is no index, there is no mapping either
        }

        if (imd == null) return false;

        MappingMetaData mdd = imd.mapping(type);

        if (mdd != null) return true;
        return false;
    }
}
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mapping()

        ClusterState cs = client.admin().cluster().prepareState().setIndices(index).execute().actionGet().getState();
        IndexMetaData imd = cs.getMetaData().index(index);

        if (imd == null) return false;

        MappingMetaData mdd = imd.mapping(type);

        if (mdd != null) return true;
        return false;
    }
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.