Skip to content

Commit

Permalink
quick test failure fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Feb 25, 2022
1 parent 224fd67 commit 17af390
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.index.query.QueryBuilder;
import org.opensearch.index.query.QueryBuilders;
import org.opensearch.plugins.Plugin;
Expand Down Expand Up @@ -544,7 +545,9 @@ private void indexRandomFrequencies01(String type) throws ExecutionException, In
if (type.equals("text")) {
textMappings += ",fielddata=true";
}
assertAcked(prepareCreate(INDEX_NAME).addMapping(TEXT_FIELD, textMappings, CLASS_FIELD, "type=keyword"));
assertAcked(
prepareCreate(INDEX_NAME).addMapping(MapperService.SINGLE_MAPPING_NAME, TEXT_FIELD, textMappings, CLASS_FIELD, "type=keyword")
);
String[] gb = { "0", "1" };
List<IndexRequestBuilder> indexRequestBuilderList = new ArrayList<>();
for (int i = 0; i < randomInt(20); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.opensearch.action.search.SearchResponse;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.index.query.QueryBuilders;
import org.opensearch.search.aggregations.BucketOrder;
import org.opensearch.search.aggregations.bucket.filter.InternalFilter;
Expand Down Expand Up @@ -72,7 +73,7 @@ public void testShardMinDocCountSignificantTermsTest() throws Exception {
}
assertAcked(
prepareCreate(index).setSettings(Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 1).put(SETTING_NUMBER_OF_REPLICAS, 0))
.addMapping("text", textMappings)
.addMapping(MapperService.SINGLE_MAPPING_NAME, "text", textMappings)
);
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();

Expand Down Expand Up @@ -141,7 +142,7 @@ public void testShardMinDocCountTermsTest() throws Exception {
}
assertAcked(
prepareCreate(index).setSettings(Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 1).put(SETTING_NUMBER_OF_REPLICAS, 0))
.addMapping("text", termMappings)
.addMapping(MapperService.SINGLE_MAPPING_NAME, "text", termMappings)
);
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();

Expand Down

0 comments on commit 17af390

Please sign in to comment.