Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3ca885e
[Close Index API] Add TransportShardCloseAction for pre-closing verif…
tlrx Dec 7, 2018
593d863
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 7, 2018
dbcafbe
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 12, 2018
40953d7
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 13, 2018
8e5dd20
[Close Index API] Refactor MetaDataIndexStateService (#36354)
tlrx Dec 13, 2018
1f6f236
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 13, 2018
79999d3
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 17, 2018
ef6ae69
[Close Index API] Adapt MetaDataIndexStateServiceTests after merge
tlrx Dec 17, 2018
7372529
[Tests] Reduce randomization in CloseWhileRelocatingShardsIT (#36694)
tlrx Dec 18, 2018
0a0c969
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 18, 2018
cd3a1af
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 18, 2018
103c4d4
[Close Index API] Mark unavailable shard copy as stale during verific…
tlrx Dec 18, 2018
c99fd6a
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 19, 2018
fb24469
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 19, 2018
bd2af2c
Merge branch 'master' into close-index-api-refactoring
tlrx Dec 21, 2018
1959388
[Close Index API] Propagate tasks ids between Freeze, Close and Verif…
tlrx Jan 7, 2019
f5af79b
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 7, 2019
e149b08
[Close Index API] Add unique UUID to ClusterBlock (#36775)
tlrx Jan 7, 2019
97bf4d7
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 7, 2019
d70ebfd
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 8, 2019
6c78aff
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 8, 2019
6e852df
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 8, 2019
be2978e
(WIP) Support for tile-based geo grid aggregation
nyurik Jan 8, 2019
5f2fbed
SQL: Replace String.format() with LoggerMessageFormat.format() (#37216)
matriv Jan 8, 2019
b6a00e0
minor cleanups, renamed "hash_type" -> "type"
nyurik Jan 8, 2019
ec32e66
Deprecate reference to _type in lookup queries (#37016)
mayya-sharipova Jan 9, 2019
38b698d
[Analysis] Deprecate Standard Html Strip Analyzer in master (#26719)
johtani Jan 9, 2019
d6ab370
added tests, mv to GeoGridAggregationBuilder2
nyurik Jan 9, 2019
2a79c46
Ensure that ActionListener is called exactly once
jkakavas Jan 9, 2019
9049263
Handle malformed license signatures (#37137)
jkakavas Jan 9, 2019
751dc1d
Implement bucket per hash type
nyurik Jan 9, 2019
2d68433
fixed most of the tests
nyurik Jan 9, 2019
d9e2ebc
Add more detail to recovery bandwidth limit docs (#37156)
DaveCTurner Jan 9, 2019
0a40564
[Tests] Change cluster scope in CorruptedFileIT and FlushIT (#37229)
tlrx Jan 9, 2019
7f6fe14
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 9, 2019
9040a96
Zen2: Add test that checks that CoordinatorTests are reproducible (#3…
ywelsch Jan 9, 2019
224475e
MINOR: Some Cleanups in Snapshots (#37175)
original-brownbear Jan 9, 2019
f14cff2
[TEST] Ensure interrupted flag reset after test that sets it (#37230)
Jan 9, 2019
096a831
Merge branch 'master' into close-index-api-refactoring
tlrx Jan 9, 2019
e0ce737
[ML] Stop datafeeds running when their jobs are stale (#37227)
Jan 9, 2019
f1f5d83
Merge branch 'close-index-api-refactoring'
tlrx Jan 9, 2019
9122585
[CCR] Added more logging.
martijnvg Jan 9, 2019
7ff846f
mute failing test: org.elasticsearch.index.shard.RefreshListenersTest…
alpar-t Jan 9, 2019
dc371ef
[Tests] Fix ReopenWhileClosingIT with correct min num shards
tlrx Jan 9, 2019
84d520b
Throw an ISE rather than an hard assertion in SearchPhaseController#g…
jimczi Jan 9, 2019
c149bb8
Support 'include_type_name' in RestGetIndicesAction (#37149)
Jan 9, 2019
7de4d2c
Mute failing test ChildQuerySearchIT
alpar-t Jan 9, 2019
ae086eb
Muting SnapshotDisruptionIT
alpar-t Jan 9, 2019
eacc63b
TESTS: Real Coordinator in SnapshotServiceTests (#37162)
original-brownbear Jan 9, 2019
85a603e
Use List instead of priority queue for stable sorting in bucket sort …
chatzikalymnios Jan 9, 2019
4efbda1
[DOCS] Rolling upgrade with old internal indices (#37184)
albertzaharovits Jan 9, 2019
d68d6aa
Compatability mode for forbidden APIs for Java 12 (#37199)
alpar-t Jan 9, 2019
6a5f3f0
Fix build on Fips
alpar-t Jan 9, 2019
13b8bad
[DOCS] Clarify client settings (#31469)
MorrieAtElastic Jan 9, 2019
cfa58a5
Add TLS/SSL channel close timeouts (#37246)
Tim-Brooks Jan 9, 2019
95eef77
[Style] Fix line length violations for threadpool, indexing, and scri…
jdconrad Jan 9, 2019
29c895b
Build: Quiet naming convention logging (#37244)
rjernst Jan 9, 2019
722b850
Build: Make assemble a noop in bwc projects (#37245)
rjernst Jan 9, 2019
c71060f
Test: fix race in auth result propagation test
jaymode Jan 9, 2019
dec436e
fix equality
nyurik Jan 9, 2019
df3b58c
ML: add migrate anomalies assistant (#36643)
benwtrent Jan 9, 2019
78f9139
Use string for ParsedGeoGrid.getKey()
nyurik Jan 9, 2019
1958730
ingest: compile mustache template only if field includes '{{'' (#37207)
jakelandis Jan 9, 2019
ede4dec
Merge remote-tracking branch 'upstream/master' into gridhash
talevy Jan 9, 2019
2d0fcae
fix styling
nyurik Jan 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ class PrecommitTasks {
project.tasks.withType(CheckForbiddenApis) {
dependsOn(buildResources)
targetCompatibility = project.runtimeJavaVersion >= JavaVersion.VERSION_1_9 ?
project.runtimeJavaVersion.getMajorVersion() :
project.runtimeJavaVersion
project.runtimeJavaVersion.getMajorVersion() : project.runtimeJavaVersion
if (project.runtimeJavaVersion > JavaVersion.VERSION_11) {
doLast {
project.logger.info(
"Forbidden APIs does not support java version past 11. Will use the signatures from 11 for ",
project.runtimeJavaVersion
)
}
targetCompatibility = JavaVersion.VERSION_11.getMajorVersion()
}
bundledSignatures = [
"jdk-unsafe", "jdk-deprecated", "jdk-non-portable", "jdk-system-out"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,18 @@ private boolean seemsLikeATest(Class<?> clazz) {

Class<?> junitTest = loadClassWithoutInitializing("org.junit.Assert", classLoader);
if (junitTest.isAssignableFrom(clazz)) {
getLogger().info("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
getLogger().debug("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
return true;
}

Class<?> junitAnnotation = loadClassWithoutInitializing("org.junit.Test", classLoader);
for (Method method : clazz.getMethods()) {
if (matchesTestMethodNamingConvention(method)) {
getLogger().info("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
getLogger().debug("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
return true;
}
if (isAnnotated(method, junitAnnotation)) {
getLogger().info("{} is a test because it has method '{}' annotated with '{}'",
getLogger().debug("{} is a test because it has method '{}' annotated with '{}'",
clazz.getName(), method.getName(), junitAnnotation.getName());
return true;
}
Expand All @@ -340,7 +340,7 @@ private boolean implementsNamingConvention(Class<?> clazz) {
if (naming.stream()
.map(TestingConventionRule::getSuffix)
.anyMatch(suffix -> clazz.getName().endsWith(suffix))) {
getLogger().info("{} is a test because it matches the naming convention", clazz.getName());
getLogger().debug("{} is a test because it matches the naming convention", clazz.getName());
return true;
}
return false;
Expand Down
13 changes: 5 additions & 8 deletions buildSrc/src/main/resources/checkstyle_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
configuration of classes that aren't in packages. -->
<suppress files="test[/\\]framework[/\\]src[/\\]test[/\\]java[/\\]Dummy.java" checks="PackageDeclaration" />

<!-- Intentionally has long example curl commands to coinncide with sibling Painless tests. -->
<suppress files="modules[/\\]lang-painless[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]painless[/\\]ContextExampleTests.java" checks="LineLength" />

<!--
Truly temporary suppressions suppression of snippets included in
documentation that are so wide that they scroll.
Expand Down Expand Up @@ -48,17 +51,11 @@
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]GcNames.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]HotThreads.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]Node.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]threadpool[/\\]ThreadPool.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]aliases[/\\]IndexAliasesIT.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indexing[/\\]IndexActionIT.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmGcMonitorServiceSettingsTests.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]routing[/\\]AliasRoutingIT.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]routing[/\\]SimpleRoutingIT.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]script[/\\]ScriptServiceTests.java" checks="LineLength" />

<!-- Temporarily contains extra-long lines as examples for tests to be written, see https://github.com/elastic/elasticsearch/issues/34829 -->
<suppress files="modules[/\\]lang-painless[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]painless[/\\]ContextExampleTests.java" checks="LineLength" />

<!-- Gradle requires inputs to be seriablizable -->
<suppress files="buildSrc[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gradle[/\\]precommit[/\\]TestingConventionRule.java" checks="RegexpSinglelineJava" />
<!-- Gradle requires inputs to be seriablizable -->
<suppress files="buildSrc[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gradle[/\\]precommit[/\\]TestingConventionRule.java" checks="RegexpSinglelineJava" />
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters;
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGrid;
import org.elasticsearch.search.aggregations.bucket.geogrid2.GeoGridAggregationBuilder2;
import org.elasticsearch.search.aggregations.bucket.geogrid2.ParsedGeoGrid;
import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.global.ParsedGlobal;
import org.elasticsearch.search.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder;
Expand Down Expand Up @@ -1759,6 +1761,7 @@ static List<NamedXContentRegistry.Entry> getDefaultNamedXContents() {
map.put(FilterAggregationBuilder.NAME, (p, c) -> ParsedFilter.fromXContent(p, (String) c));
map.put(InternalSampler.PARSER_NAME, (p, c) -> ParsedSampler.fromXContent(p, (String) c));
map.put(GeoGridAggregationBuilder.NAME, (p, c) -> ParsedGeoHashGrid.fromXContent(p, (String) c));
map.put(GeoGridAggregationBuilder2.NAME, (p, c) -> ParsedGeoGrid.fromXContent(p, (String) c));
map.put(RangeAggregationBuilder.NAME, (p, c) -> ParsedRange.fromXContent(p, (String) c));
map.put(DateRangeAggregationBuilder.NAME, (p, c) -> ParsedDateRange.fromXContent(p, (String) c));
map.put(GeoDistanceAggregationBuilder.NAME, (p, c) -> ParsedGeoDistance.fromXContent(p, (String) c));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ public void testUpdateByQuery() throws Exception {
// test1: create one doc in dest
UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest();
updateByQueryRequest.indices(sourceIndex);
updateByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1").types("_doc"));
updateByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1"));
updateByQueryRequest.setRefresh(true);
BulkByScrollResponse bulkResponse =
execute(updateByQueryRequest, highLevelClient()::updateByQuery, highLevelClient()::updateByQueryAsync);
Expand Down Expand Up @@ -917,7 +917,7 @@ public void testUpdateByQuery() throws Exception {
// test update-by-query rethrottling
UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest();
updateByQueryRequest.indices(sourceIndex);
updateByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1").types("_doc"));
updateByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1"));
updateByQueryRequest.setRefresh(true);

// this following settings are supposed to halt reindexing after first document
Expand Down Expand Up @@ -987,7 +987,7 @@ public void testDeleteByQuery() throws Exception {
// test1: delete one doc
DeleteByQueryRequest deleteByQueryRequest = new DeleteByQueryRequest();
deleteByQueryRequest.indices(sourceIndex);
deleteByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1").types("_doc"));
deleteByQueryRequest.setQuery(new IdsQueryBuilder().addIds("1"));
deleteByQueryRequest.setRefresh(true);
BulkByScrollResponse bulkResponse =
execute(deleteByQueryRequest, highLevelClient()::deleteByQuery, highLevelClient()::deleteByQueryAsync);
Expand All @@ -1009,7 +1009,7 @@ public void testDeleteByQuery() throws Exception {
// test delete-by-query rethrottling
DeleteByQueryRequest deleteByQueryRequest = new DeleteByQueryRequest();
deleteByQueryRequest.indices(sourceIndex);
deleteByQueryRequest.setQuery(new IdsQueryBuilder().addIds("2", "3").types("_doc"));
deleteByQueryRequest.setQuery(new IdsQueryBuilder().addIds("2", "3"));
deleteByQueryRequest.setRefresh(true);

// this following settings are supposed to halt reindexing after first document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.rest.RestStatus;
Expand Down Expand Up @@ -209,7 +210,7 @@ public void testCreateIndex() throws IOException {
mappingBuilder.startObject().startObject("properties").startObject("field");
mappingBuilder.field("type", "text");
mappingBuilder.endObject().endObject().endObject();
createIndexRequest.mapping("type_name", mappingBuilder);
createIndexRequest.mapping(MapperService.SINGLE_MAPPING_NAME, mappingBuilder);

CreateIndexResponse createIndexResponse =
execute(createIndexRequest, highLevelClient().indices()::create, highLevelClient().indices()::createAsync);
Expand All @@ -226,7 +227,7 @@ public void testCreateIndex() throws IOException {
Map<String, Object> term = (Map) filter.get("term");
assertEquals(2016, term.get("year"));

assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings.type_name.properties.field.type", getIndexResponse));
assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings.properties.field.type", getIndexResponse));
}
}

Expand Down Expand Up @@ -340,7 +341,7 @@ public void testGetIndex() throws IOException {
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)
.build();
String mappings = "\"type-1\":{\"properties\":{\"field-1\":{\"type\":\"integer\"}}}";
String mappings = "\"_doc\":{\"properties\":{\"field-1\":{\"type\":\"integer\"}}}";
createIndex(indexName, basicSettings, mappings);

GetIndexRequest getIndexRequest = new GetIndexRequest()
Expand All @@ -353,8 +354,8 @@ public void testGetIndex() throws IOException {
assertEquals("1", getIndexResponse.getSetting(indexName, SETTING_NUMBER_OF_SHARDS));
assertEquals("0", getIndexResponse.getSetting(indexName, SETTING_NUMBER_OF_REPLICAS));
assertNotNull(getIndexResponse.getMappings().get(indexName));
assertNotNull(getIndexResponse.getMappings().get(indexName).get("type-1"));
Object o = getIndexResponse.getMappings().get(indexName).get("type-1").getSourceAsMap().get("properties");
assertNotNull(getIndexResponse.getMappings().get(indexName).get("_doc"));
Object o = getIndexResponse.getMappings().get(indexName).get("_doc").getSourceAsMap().get("properties");
assertThat(o, instanceOf(Map.class));
//noinspection unchecked
assertThat(((Map<String, Object>) o).get("field-1"), instanceOf(Map.class));
Expand All @@ -370,7 +371,7 @@ public void testGetIndexWithDefaults() throws IOException {
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)
.build();
String mappings = "\"type-1\":{\"properties\":{\"field-1\":{\"type\":\"integer\"}}}";
String mappings = "\"_doc\":{\"properties\":{\"field-1\":{\"type\":\"integer\"}}}";
createIndex(indexName, basicSettings, mappings);

GetIndexRequest getIndexRequest = new GetIndexRequest()
Expand All @@ -384,8 +385,8 @@ public void testGetIndexWithDefaults() throws IOException {
assertEquals("1", getIndexResponse.getSetting(indexName, SETTING_NUMBER_OF_SHARDS));
assertEquals("0", getIndexResponse.getSetting(indexName, SETTING_NUMBER_OF_REPLICAS));
assertNotNull(getIndexResponse.getMappings().get(indexName));
assertNotNull(getIndexResponse.getMappings().get(indexName).get("type-1"));
Object o = getIndexResponse.getMappings().get(indexName).get("type-1").getSourceAsMap().get("properties");
assertNotNull(getIndexResponse.getMappings().get(indexName).get("_doc"));
Object o = getIndexResponse.getMappings().get(indexName).get("_doc").getSourceAsMap().get("properties");
assertThat(o, instanceOf(Map.class));
assertThat(((Map<String, Object>) o).get("field-1"), instanceOf(Map.class));
Map<String, Object> fieldMapping = (Map<String, Object>) ((Map<String, Object>) o).get("field-1");
Expand All @@ -408,7 +409,7 @@ public void testPutMapping() throws IOException {
createIndex(indexName, Settings.EMPTY);

PutMappingRequest putMappingRequest = new PutMappingRequest(indexName);
putMappingRequest.type("type_name");
putMappingRequest.type("_doc");
XContentBuilder mappingBuilder = JsonXContent.contentBuilder();
mappingBuilder.startObject().startObject("properties").startObject("field");
mappingBuilder.field("type", "text");
Expand All @@ -420,7 +421,7 @@ public void testPutMapping() throws IOException {
assertTrue(putMappingResponse.isAcknowledged());

Map<String, Object> getIndexResponse = getAsMap(indexName);
assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings.type_name.properties.field.type", getIndexResponse));
assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings.properties.field.type", getIndexResponse));
}

public void testGetMapping() throws IOException {
Expand All @@ -440,7 +441,7 @@ public void testGetMapping() throws IOException {
assertTrue(putMappingResponse.isAcknowledged());

Map<String, Object> getIndexResponse = getAsMap(indexName);
assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings._doc.properties.field.type", getIndexResponse));
assertEquals("text", XContentMapValues.extractValue(indexName + ".mappings.properties.field.type", getIndexResponse));

GetMappingsRequest request = new GetMappingsRequest()
.indices(indexName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.GetAliasesResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.SyncedFlushResponse;
import org.elasticsearch.client.core.ShardsAcknowledgedResponse;
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
import org.elasticsearch.client.core.ShardsAcknowledgedResponse;
import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.cluster.metadata.MappingMetaData;
Expand Down Expand Up @@ -1249,7 +1249,7 @@ public void testGetIndex() throws Exception {
Settings settings = Settings.builder().put("number_of_shards", 3).build();
String mappings = "{\"properties\":{\"field-1\":{\"type\":\"integer\"}}}";
CreateIndexResponse createIndexResponse = client.indices().create(
new CreateIndexRequest("index", settings).mapping("doc", mappings, XContentType.JSON),
new CreateIndexRequest("index", settings).mapping("_doc", mappings, XContentType.JSON),
RequestOptions.DEFAULT);
assertTrue(createIndexResponse.isAcknowledged());
}
Expand All @@ -1272,7 +1272,7 @@ public void testGetIndex() throws Exception {

// tag::get-index-response
ImmutableOpenMap<String, MappingMetaData> indexMappings = getIndexResponse.getMappings().get("index"); // <1>
Map<String, Object> indexTypeMappings = indexMappings.get("doc").getSourceAsMap(); // <2>
Map<String, Object> indexTypeMappings = indexMappings.get("_doc").getSourceAsMap(); // <2>
List<AliasMetaData> indexAliases = getIndexResponse.getAliases().get("index"); // <3>
String numberOfShardsString = getIndexResponse.getSetting("index", "index.number_of_shards"); // <4>
Settings indexSettings = getIndexResponse.getSettings().get("index"); // <5>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ public void testGeoShape() throws IOException {
// Using pre-indexed shapes
GeoShapeQueryBuilder qb = geoShapeQuery(
"pin.location", // <1>
"DEU", // <2>
"countries"); // <3>
qb.relation(ShapeRelation.WITHIN) // <4>
.indexedShapeIndex("shapes") // <5>
.indexedShapePath("location"); // <6>
"DEU"); // <2>
qb.relation(ShapeRelation.WITHIN) // <3>
.indexedShapeIndex("shapes") // <4>
.indexedShapePath("location"); // <5>
// end::indexed_geo_shape
}
}
Expand All @@ -236,9 +235,6 @@ public void testHasParent() {

public void testIds() {
// tag::ids
idsQuery("my_type", "type2")
.addIds("1", "4", "100");

idsQuery() // <1>
.addIds("1", "4", "100");
// end::ids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import org.apache.http.util.EntityUtils;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.ResponseListener;
import org.elasticsearch.client.Request;
import org.junit.After;
import org.junit.Before;

Expand Down
Loading