Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into add-cluster-manager…
Browse files Browse the repository at this point in the history
…-timeout

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 17, 2022
2 parents b99c8d5 + f14e0a3 commit ec61416
Show file tree
Hide file tree
Showing 30 changed files with 1,348 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void testConvertScalarToList() throws Exception {
public void testAppendMetadataExceptVersion() throws Exception {
// here any metadata field value becomes a list, which won't make sense in most of the cases,
// but support for append is streamlined like for set so we test it
Metadata randomMetadata = randomFrom(Metadata.INDEX, Metadata.TYPE, Metadata.ID, Metadata.ROUTING);
Metadata randomMetadata = randomFrom(Metadata.INDEX, Metadata.ID, Metadata.ROUTING);
List<String> values = new ArrayList<>();
Processor appendProcessor;
if (randomBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void testSetExistingNullFieldWithOverrideDisabled() throws Exception {
}

public void testSetMetadataExceptVersion() throws Exception {
Metadata randomMetadata = randomFrom(Metadata.INDEX, Metadata.TYPE, Metadata.ID, Metadata.ROUTING);
Metadata randomMetadata = randomFrom(Metadata.INDEX, Metadata.ID, Metadata.ROUTING);
Processor processor = createSetProcessor(randomMetadata.getFieldName(), "_value", true, false);
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random());
processor.execute(ingestDocument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
"_doc",
new CompressedXContent(
Strings.toString(
PutMappingRequest.buildFromSimplifiedDef(
PutMappingRequest.simpleMapping(
"my_feature_field",
"type=rank_feature",
"my_negative_feature_field",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public void testPercolatorQueryWithHighlighting() throws Exception {
client().admin()
.indices()
.prepareCreate("test")
.addMapping("type", "id", "type=keyword", "field1", fieldMapping, "query", "type=percolator")
.addMapping("type", "id", "type=keyword", "field1", fieldMapping.toString(), "query", "type=percolator")
);
client().prepareIndex("test")
.setId("1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
docType,
new CompressedXContent(
Strings.toString(
PutMappingRequest.buildFromSimplifiedDef(queryField, "type=percolator", aliasField, "type=alias,path=" + queryField)
PutMappingRequest.simpleMapping(queryField, "type=percolator", aliasField, "type=alias,path=" + queryField)
)
),
MapperService.MergeReason.MAPPING_UPDATE
);
mapperService.merge(
docType,
new CompressedXContent(Strings.toString(PutMappingRequest.buildFromSimplifiedDef(TEXT_FIELD_NAME, "type=text"))),
new CompressedXContent(Strings.toString(PutMappingRequest.simpleMapping(TEXT_FIELD_NAME, "type=text"))),
MapperService.MergeReason.MAPPING_UPDATE
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
super.initializeAdditionalMappings(mapperService);
mapperService.merge(
"_doc",
new CompressedXContent(Strings.toString(PutMappingRequest.buildFromSimplifiedDef("some_nested_object", "type=nested"))),
new CompressedXContent(Strings.toString(PutMappingRequest.simpleMapping("some_nested_object", "type=nested"))),
MapperService.MergeReason.MAPPING_UPDATE
);
}
Expand Down
Loading

0 comments on commit ec61416

Please sign in to comment.