Search in sources :

Example 1 with PutMappingRequestBuilder

use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project sonarqube by SonarSource.

the class ProxyPutMappingRequestBuilderTest method trace_logs.

@Test
public void trace_logs() {
    logTester.setLevel(LoggerLevel.TRACE);
    PutMappingRequestBuilder requestBuilder = esTester.client().preparePutMapping(FakeIndexDefinition.INDEX).setType(FakeIndexDefinition.TYPE).setSource(mapDomain());
    requestBuilder.get();
    assertThat(logTester.logs(LoggerLevel.TRACE)).hasSize(1);
}
Also used : PutMappingRequestBuilder(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder) Test(org.junit.Test)

Example 2 with PutMappingRequestBuilder

use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project sonarqube by SonarSource.

the class ProxyPutMappingRequestBuilderTest method put_mapping.

@Test
public void put_mapping() {
    PutMappingRequestBuilder requestBuilder = esTester.client().preparePutMapping(FakeIndexDefinition.INDEX).setType(FakeIndexDefinition.TYPE).setSource(mapDomain());
    requestBuilder.get();
}
Also used : PutMappingRequestBuilder(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder) Test(org.junit.Test)

Example 3 with PutMappingRequestBuilder

use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project elasticsearch-opennlp-plugin by spinscale.

the class OpenNlpPluginIntegrationTest method putMapping.

private void putMapping(String mappingFile) throws IOException {
    String mapping = copyToStringFromClasspath(mappingFile);
    PutMappingRequestBuilder putMappingRequestBuilder = new PutMappingRequestBuilder(node.client().admin().indices());
    PutMappingResponse putMappingResponse = putMappingRequestBuilder.setIndices(index).setType(type).setSource(mapping).execute().actionGet();
    assertThat(putMappingResponse.isAcknowledged(), is(true));
}
Also used : PutMappingRequestBuilder(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder) PutMappingResponse(org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse)

Aggregations

PutMappingRequestBuilder (org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder)3 Test (org.junit.Test)2 PutMappingResponse (org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse)1