Tabnine Logo
PutMappingRequestBuilder.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder

Best Java code snippets using org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder.get (Showing top 20 results out of 315)

origin: SonarSource/sonarqube

@Test
public void fail_on_bad_query() {
 try {
  es.client().preparePutMapping().get();
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class);
  assertThat(e.getMessage()).contains("Fail to execute ES put mapping request");
 }
}
origin: SonarSource/sonarqube

@Test
public void get_with_string_timeout_is_not_yet_implemented() {
 try {
  es.client().preparePutMapping().get("1");
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("Not yet implemented");
 }
}
origin: SonarSource/sonarqube

@Test
public void get_with_time_value_timeout_is_not_yet_implemented() {
 try {
  es.client().preparePutMapping().get(TimeValue.timeValueMinutes(1));
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("Not yet implemented");
 }
}
origin: SonarSource/sonarqube

 .setType(entry.getKey())
 .setSource(entry.getValue().getAttributes())
 .get();
if (!mappingResponse.isAcknowledged()) {
 throw new IllegalStateException("Failed to create type " + entry.getKey());
origin: SonarSource/sonarqube

@Test
public void trace_logs() {
 logTester.setLevel(LoggerLevel.TRACE);
 PutMappingRequestBuilder requestBuilder = es.client().preparePutMapping(FakeIndexDefinition.INDEX)
  .setType(FakeIndexDefinition.TYPE)
  .setSource(mapDomain());
 requestBuilder.get();
 assertThat(logTester.logs(LoggerLevel.TRACE)).hasSize(1);
}
origin: richardwilly98/elasticsearch-river-mongodb

if (client.admin().indices().prepareDeleteMapping(index).setType(type).get().isAcknowledged()) {
  PutMappingResponse pmr = client.admin().indices().preparePutMapping(index).setType(type)
      .setSource(mapping.getSourceAsMap()).get();
  if (!pmr.isAcknowledged()) {
    logger.error("Failed to put mapping {} / {} / {}.", index, type, mapping.source());
origin: SonarSource/sonarqube

@Test
public void put_mapping() {
 PutMappingRequestBuilder requestBuilder = es.client().preparePutMapping(FakeIndexDefinition.INDEX)
  .setType(FakeIndexDefinition.TYPE)
  .setSource(mapDomain());
 requestBuilder.get();
}
origin: SonarSource/sonarqube

 .setType(entry.getKey())
 .setSource(entry.getValue().getAttributes())
 .get();
if (!mappingResponse.isAcknowledged()) {
 throw new IllegalStateException("Failed to create type " + entry.getKey());
origin: richardwilly98/elasticsearch-river-mongodb

      .setSource(getGridFSMapping()).get();
} catch (Exception e) {
  logger.warn("Failed to set explicit mapping (attachment): {}", e);
origin: org.elasticsearch/elasticsearch

  /**
   * Update mappings synchronously on the master node, waiting for at most
   * {@code timeout}. When this method returns successfully mappings have
   * been applied to the master node and propagated to data nodes.
   */
  public void updateMappingOnMaster(Index index, String type, Mapping mappingUpdate, TimeValue timeout) {
    if (updateMappingRequest(index, type, mappingUpdate, timeout).get().isAcknowledged() == false) {
      throw new ElasticsearchTimeoutException("Failed to acknowledge mapping update within [" + timeout + "]");
    }
  }
}
origin: org.elasticsearch/elasticsearch

@Override
public IndexShard createShard(ShardRouting shardRouting, RecoveryState recoveryState, PeerRecoveryTargetService recoveryTargetService,
               PeerRecoveryTargetService.RecoveryListener recoveryListener, RepositoriesService repositoriesService,
               Consumer<IndexShard.ShardFailure> onShardFailure,
               Consumer<ShardId> globalCheckpointSyncer) throws IOException {
  ensureChangesAllowed();
  IndexService indexService = indexService(shardRouting.index());
  IndexShard indexShard = indexService.createShard(shardRouting, globalCheckpointSyncer);
  indexShard.addShardFailureCallback(onShardFailure);
  indexShard.startRecovery(recoveryState, recoveryTargetService, recoveryListener, repositoriesService,
    (type, mapping) -> {
      assert recoveryState.getRecoverySource().getType() == RecoverySource.Type.LOCAL_SHARDS:
        "mapping update consumer only required by local shards recovery";
      client.admin().indices().preparePutMapping()
        .setConcreteIndex(shardRouting.index()) // concrete index - no name clash, it uses uuid
        .setType(type)
        .setSource(mapping.source().string(), XContentType.JSON)
        .get();
    }, this);
  return indexShard;
}
origin: com.strapdata.elasticsearch/elasticsearch

  /**
   * Update mappings synchronously on the master node, waiting for at most
   * {@code timeout}. When this method returns successfully mappings have
   * been applied to the master node and propagated to data nodes.
   */
  public void updateMappingOnMaster(Index index, String type, Mapping mappingUpdate, TimeValue timeout) throws Exception {
    if (updateMappingRequest(index, type, mappingUpdate, timeout).get().isAcknowledged() == false) {
      throw new TimeoutException("Failed to acknowledge mapping update within [" + timeout + "]");
    }
  }
}
origin: harbby/presto-connectors

/**
 * Update mappings synchronously on the master node, waiting for at most
 * {@code timeout}. When this method returns successfully mappings have
 * been applied to the master node and propagated to data nodes.
 */
public void updateMappingOnMasterSynchronously(String index, String type, Mapping mappingUpdate, TimeValue timeout) throws Throwable {
  if (updateMappingRequest(index, type, mappingUpdate, timeout).get().isAcknowledged() == false) {
    throw new TimeoutException("Failed to acknowledge mapping update within [" + timeout + "]");
  }
}
origin: org.nuxeo.elasticsearch/nuxeo-elasticsearch-core

@Override
public void createMapping(String indexName, String type, String jsonMapping) {
  client.admin()
     .indices()
     .preparePutMapping(indexName)
     .setType(type)
     .setSource(jsonMapping, XContentType.JSON)
     .get();
}
origin: apache/servicemix-bundles

  /**
   * Update mappings synchronously on the master node, waiting for at most
   * {@code timeout}. When this method returns successfully mappings have
   * been applied to the master node and propagated to data nodes.
   */
  public void updateMappingOnMaster(Index index, String type, Mapping mappingUpdate, TimeValue timeout) {
    if (updateMappingRequest(index, type, mappingUpdate, timeout).get().isAcknowledged() == false) {
      throw new ElasticsearchTimeoutException("Failed to acknowledge mapping update within [" + timeout + "]");
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  /**
   * Update mappings synchronously on the master node, waiting for at most
   * {@code timeout}. When this method returns successfully mappings have
   * been applied to the master node and propagated to data nodes.
   */
  public void updateMappingOnMaster(Index index, String type, Mapping mappingUpdate, TimeValue timeout) {
    if (updateMappingRequest(index, type, mappingUpdate, timeout).get().isAcknowledged() == false) {
      throw new ElasticsearchTimeoutException("Failed to acknowledge mapping update within [" + timeout + "]");
    }
  }
}
origin: jaibeermalik/elasticsearch-tutorial

@Override
public void updateDocumentTypeMapping(ElasticSearchIndexConfig config, String documentType, boolean parentRelationship)
{
  try
  {
    searchClientService.getClient().admin().indices().preparePutMapping(config.getIndexAliasName())
                              .setType(documentType)
                              .setSource(new IndexSchemaBuilder().getDocumentTypeMapping(config, documentType, parentRelationship))
                              .get();
  } catch (IOException e)
  {
    throw new RuntimeException("Error occurend while generating mapping for document type", e);
  }
}

origin: kiegroup/appformer

public void putMapping(String index,
            String type,
            List<MetaProperty> metaProperties) {
  checkNotEmpty("index",
         index);
  checkNotEmpty("type",
         type);
  Map<String, Object> properties = this.createMappingMap(metaProperties);
  this.getClient().admin().indices().preparePutMapping(sanitizeIndex(index)).setType(sanitizeIndex(type)).setSource(properties).get();
}
origin: org.uberfire/uberfire-metadata-backend-elasticsearch

public void putMapping(String index,
            String type,
            List<MetaProperty> metaProperties) {
  checkNotEmpty("index",
         index);
  checkNotEmpty("type",
         type);
  Map<String, Object> properties = this.createMappingMap(metaProperties);
  this.getClient().admin().indices().preparePutMapping(sanitizeIndex(index)).setType(sanitizeIndex(type)).setSource(properties).get();
}
origin: kiegroup/appformer

public void putMapping(String index,
            String type,
            MetaObject metaObject) {
  checkNotEmpty("index",
         index);
  checkNotEmpty("type",
         type);
  checkNotNull("metaObject",
         metaObject);
  try {
    this.getClient().admin().indices().prepareCreate(sanitizeIndex(index)).get();
  } catch (ResourceAlreadyExistsException ex) {
    logger.debug("Resource Already exists: " + ex.getMessage());
  }
  Map<String, Object> properties = this.createMappingMap(metaObject.getProperties());
  this.getClient().admin().indices()
      .preparePutMapping(sanitizeIndex(index))
      .setType(sanitizeIndex(type))
      .setSource(properties).get();
}
org.elasticsearch.action.admin.indices.mapping.putPutMappingRequestBuilderget

Popular methods of PutMappingRequestBuilder

  • setSource
    A specialized simplified mapping source method, takes the form of simple properties definition: ("fi
  • setType
    The type of the mappings.
  • execute
  • setIgnoreConflicts
  • setIndices
  • <init>
  • setMasterNodeTimeout
  • setTimeout
  • setConcreteIndex
  • setUpdateAllTypes
    True if all fields that span multiple types should be updated, false otherwise

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • Menu (java.awt)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now