Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
jpountz committed Jan 22, 2018
1 parent a29e695 commit 35ce44c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ public void testMergeText() throws Exception {
String mapping = XContentFactory.jsonBuilder().startObject().startObject("_doc")
.startObject("properties").startObject("date").field("type", "date").endObject()
.endObject().endObject().endObject().string();
DocumentMapper mapper = indexService.mapperService().parse("_doc", new CompressedXContent(mapping), false);
DocumentMapper mapper = indexService.mapperService().parse("_doc", new CompressedXContent(mapping));

String mappingUpdate = XContentFactory.jsonBuilder().startObject().startObject("_doc")
.startObject("properties").startObject("date").field("type", "text").endObject()
.endObject().endObject().endObject().string();
DocumentMapper update = indexService.mapperService().parse("_doc", new CompressedXContent(mappingUpdate), false);
DocumentMapper update = indexService.mapperService().parse("_doc", new CompressedXContent(mappingUpdate));

IllegalArgumentException e = expectThrows(IllegalArgumentException.class,
() -> mapper.merge(update.mapping()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,4 @@ public void testForbidMultipleTypes() throws IOException {
assertThat(e.getMessage(), Matchers.startsWith("Rejecting mapping update to [test] as the final mapping would have more than 1 type: "));
}

<<<<<<< 700d9ecc953fa30df0d12d086f0e9d9322446459
public void testDefaultMappingIsDeprecated() throws IOException {
String mapping = XContentFactory.jsonBuilder().startObject().startObject("_default_").endObject().endObject().string();
MapperService mapperService = createIndex("test").mapperService();
mapperService.merge("_default_", new CompressedXContent(mapping), MergeReason.MAPPING_UPDATE);
assertWarnings("[_default_] mapping is deprecated since it is not useful anymore now that indexes " +
"cannot have more than one type");
}
=======
>>>>>>> Remove the `_default_` mapping.
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testExceptionForCopyToInMultiFields() throws IOException {
// first check that for newer versions we throw exception if copy_to is found withing multi field
MapperService mapperService = MapperTestUtils.newMapperService(xContentRegistry(), createTempDir(), Settings.EMPTY, "test");
try {
mapperService.parse("type", new CompressedXContent(mapping.string()), true);
mapperService.parse("type", new CompressedXContent(mapping.string()));
fail("Parsing should throw an exception because the mapping contains a copy_to in a multi field");
} catch (MapperParsingException e) {
assertThat(e.getMessage(), equalTo("copy_to in multi fields is not allowed. Found the copy_to in field [c] which is within a multi field."));
Expand Down

0 comments on commit 35ce44c

Please sign in to comment.