From 25ba05bab48d15758b42468eb78328473be176a7 Mon Sep 17 00:00:00 2001 From: Rabi Panda Date: Wed, 24 Mar 2021 16:44:58 -0700 Subject: [PATCH 1/3] Use alternate test data. This commit updates some of the sample test data used in test cases in OpenSearch. Signed-off-by: Rabi Panda --- .../opensearch/client/IndicesClientIT.java | 2 +- .../documentation/CRUDDocumentationIT.java | 30 ++++++------- .../IndicesClientDocumentationIT.java | 6 +-- .../QueryDSLDocumentationTests.java | 28 ++++++------- .../documentation/SearchDocumentationIT.java | 42 +++++++++---------- .../common/SynonymsAnalysisTests.java | 24 +++++------ .../opensearch/analysis/common/synonyms.json | 8 ++-- .../opensearch/analysis/common/synonyms.txt | 4 +- .../test/indices.analyze/10_analyze.yml | 8 ++-- .../test/indices.analyze/10_synonyms.yml | 8 ++-- .../test/delete_by_query/10_basic.yml | 22 +++++----- .../test/reindex/85_scripting.yml | 32 +++++++------- .../test/update_by_query/10_basic.yml | 22 +++++----- .../test/update_by_query/80_scripting.yml | 20 ++++----- .../attachment/AttachmentProcessorTests.java | 2 +- .../sample-files/htmlWithEmptyDateMeta.html | 2 +- .../sample-files/htmlWithValidDateMeta.html | 2 +- .../sample-files/htmlWithoutDateMeta.html | 2 +- .../ingest/30_update_by_query_with_ingest.yml | 2 +- .../test/ingest/40_reindex_with_ingest.yml | 2 +- .../indices.put_index_template/10_basic.yml | 4 +- .../test/indices.put_template/10_basic.yml | 4 +- .../opensearch/aliases/IndexAliasesIT.java | 8 ++-- .../search/nested/SimpleNestedIT.java | 14 +++---- .../search/query/SearchQueryIT.java | 8 ++-- .../search/scroll/SearchScrollIT.java | 4 +- .../validate/SimpleValidateQueryIT.java | 4 +- .../metadata/ToAndFromJsonMetadataTests.java | 6 +-- .../index/mapper/DocumentParserTests.java | 12 +++--- .../index/query/BoolQueryBuilderTests.java | 4 +- .../query/ConstantScoreQueryBuilderTests.java | 2 +- .../query/SpanFirstQueryBuilderTests.java | 6 +-- .../query/SpanTermQueryBuilderTests.java | 4 +- .../index/query/TermsQueryBuilderTests.java | 2 +- .../indices/RestValidateQueryActionTests.java | 2 +- .../mapper/simple/test1-notype-noid.json | 4 +- .../opensearch/index/mapper/simple/test1.json | 4 +- 37 files changed, 180 insertions(+), 180 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java index 4c4f95ef6718a..ce513c29a3021 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java @@ -1730,7 +1730,7 @@ public void testValidateQuery() throws IOException{ QueryBuilder builder = QueryBuilders .boolQuery() .must(QueryBuilders.queryStringQuery("*:*")) - .filter(QueryBuilders.termQuery("user", "kimchy")); + .filter(QueryBuilders.termQuery("user", "foobar")); ValidateQueryRequest request = new ValidateQueryRequest(index).query(builder); request.explain(randomBoolean()); ValidateQueryResponse response = execute(request, highLevelClient().indices()::validateQuery, diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java index 97ff0940d039b..b42c5e78de653 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java @@ -115,7 +115,7 @@ public void testIndex() throws Exception { { //tag::index-request-map Map jsonMap = new HashMap<>(); - jsonMap.put("user", "kimchy"); + jsonMap.put("user", "foobar"); jsonMap.put("postDate", new Date()); jsonMap.put("message", "trying out OpenSearch"); IndexRequest indexRequest = new IndexRequest("posts") @@ -129,7 +129,7 @@ public void testIndex() throws Exception { XContentBuilder builder = XContentFactory.jsonBuilder(); builder.startObject(); { - builder.field("user", "kimchy"); + builder.field("user", "foobar"); builder.timeField("postDate", new Date()); builder.field("message", "trying out OpenSearch"); } @@ -144,7 +144,7 @@ public void testIndex() throws Exception { //tag::index-request-shortcut IndexRequest indexRequest = new IndexRequest("posts") .id("1") - .source("user", "kimchy", + .source("user", "foobar", "postDate", new Date(), "message", "trying out OpenSearch"); // <1> //end::index-request-shortcut @@ -156,7 +156,7 @@ public void testIndex() throws Exception { IndexRequest request = new IndexRequest("posts"); // <1> request.id("1"); // <2> String jsonString = "{" + - "\"user\":\"kimchy\"," + + "\"user\":\"foobar\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out OpenSearch\"" + "}"; @@ -838,7 +838,7 @@ public void testReindex() throws Exception { request.setScript( new Script( ScriptType.INLINE, "painless", - "if (ctx._source.user == 'kimchy') {ctx._source.likes++;}", + "if (ctx._source.user == 'foobar') {ctx._source.likes++;}", Collections.emptyMap())); // <1> // end::reindex-request-script HttpHost host = getClusterHosts().get(0); @@ -903,7 +903,7 @@ public void testReindex() throws Exception { // These cannot be set with a remote set, so its set here instead for the docs // tag::reindex-request-query - request.setSourceQuery(new TermQueryBuilder("user", "kimchy")); // <1> + request.setSourceQuery(new TermQueryBuilder("user", "foobar")); // <1> // end::reindex-request-query // tag::reindex-request-slices request.setSlices(2); // <1> @@ -1021,7 +1021,7 @@ public void testUpdateByQuery() throws Exception { request.setConflicts("proceed"); // <1> // end::update-by-query-request-conflicts // tag::update-by-query-request-query - request.setQuery(new TermQueryBuilder("user", "kimchy")); // <1> + request.setQuery(new TermQueryBuilder("user", "foobar")); // <1> // end::update-by-query-request-query // tag::update-by-query-request-maxDocs request.setMaxDocs(10); // <1> @@ -1036,7 +1036,7 @@ public void testUpdateByQuery() throws Exception { request.setScript( new Script( ScriptType.INLINE, "painless", - "if (ctx._source.user == 'kimchy') {ctx._source.likes++;}", + "if (ctx._source.user == 'foobar') {ctx._source.likes++;}", Collections.emptyMap())); // <1> // end::update-by-query-request-script // tag::update-by-query-request-timeout @@ -1143,7 +1143,7 @@ public void testDeleteByQuery() throws Exception { request.setConflicts("proceed"); // <1> // end::delete-by-query-request-conflicts // tag::delete-by-query-request-query - request.setQuery(new TermQueryBuilder("user", "kimchy")); // <1> + request.setQuery(new TermQueryBuilder("user", "foobar")); // <1> // end::delete-by-query-request-query // tag::delete-by-query-request-maxDocs request.setMaxDocs(10); // <1> @@ -1246,7 +1246,7 @@ public void testGet() throws Exception { assertEquals(200, response.getStatusLine().getStatusCode()); IndexRequest indexRequest = new IndexRequest("posts").id("1") - .source("user", "kimchy", + .source("user", "foobar", "postDate", new Date(), "message", "trying out OpenSearch"); IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT); @@ -1312,7 +1312,7 @@ public void testGet() throws Exception { GetResponse getResponse = client.get(request, RequestOptions.DEFAULT); Map sourceAsMap = getResponse.getSourceAsMap(); assertEquals(2, sourceAsMap.size()); - assertEquals("kimchy", sourceAsMap.get("user")); + assertEquals("foobar", sourceAsMap.get("user")); assertTrue(sourceAsMap.containsKey("postDate")); } { @@ -1419,7 +1419,7 @@ public void testGetSource() throws Exception { assertEquals(200, response.getStatusLine().getStatusCode()); IndexRequest indexRequest = new IndexRequest("posts").id("1") - .source("user", "kimchy", + .source("user", "foobar", "postDate", new Date(), "message", "trying out OpenSearch"); IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT); @@ -1462,7 +1462,7 @@ public void testGetSource() throws Exception { // end::get-source-response Map expectSource = new HashMap<>(); - expectSource.put("user", "kimchy"); + expectSource.put("user", "foobar"); expectSource.put("message", "trying out OpenSearch"); assertEquals(expectSource, source); } @@ -1651,7 +1651,7 @@ public void testTermVectors() throws Exception { .endObject()); CreateIndexResponse authorsResponse = client.indices().create(authorsRequest, RequestOptions.DEFAULT); assertTrue(authorsResponse.isAcknowledged()); - client.index(new IndexRequest("index").id("1").source("user", "kimchy"), RequestOptions.DEFAULT); + client.index(new IndexRequest("index").id("1").source("user", "foobar"), RequestOptions.DEFAULT); Response refreshResponse = client().performRequest(new Request("POST", "/authors/_refresh")); assertEquals(200, refreshResponse.getStatusLine().getStatusCode()); @@ -1782,7 +1782,7 @@ public void testMultiTermVectors() throws Exception { .endObject()); CreateIndexResponse authorsResponse = client.indices().create(authorsRequest, RequestOptions.DEFAULT); assertTrue(authorsResponse.isAcknowledged()); - client.index(new IndexRequest("index").id("1").source("user", "kimchy"), RequestOptions.DEFAULT); + client.index(new IndexRequest("index").id("1").source("user", "foobar"), RequestOptions.DEFAULT); client.index(new IndexRequest("index").id("2").source("user", "s1monw"), RequestOptions.DEFAULT); Response refreshResponse = client().performRequest(new Request("POST", "/authors/_refresh")); assertEquals(200, refreshResponse.getStatusLine().getStatusCode()); diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/IndicesClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/IndicesClientDocumentationIT.java index ab99dbf7cb422..821ea52594107 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/IndicesClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/IndicesClientDocumentationIT.java @@ -363,7 +363,7 @@ public void testCreateIndex() throws IOException { request = new CreateIndexRequest("twitter5"); // tag::create-index-request-aliases - request.alias(new Alias("twitter_alias").filter(QueryBuilders.termQuery("user", "kimchy"))); // <1> + request.alias(new Alias("twitter_alias").filter(QueryBuilders.termQuery("user", "foobar"))); // <1> // end::create-index-request-aliases // tag::create-index-request-timeout @@ -2216,7 +2216,7 @@ public void testPutTemplate() throws Exception { } // tag::put-template-request-aliases - request.alias(new Alias("twitter_alias").filter(QueryBuilders.termQuery("user", "kimchy"))); // <1> + request.alias(new Alias("twitter_alias").filter(QueryBuilders.termQuery("user", "foobar"))); // <1> request.alias(new Alias("{index}_alias").searchRouting("xyz")); // <2> // end::put-template-request-aliases @@ -2763,7 +2763,7 @@ public void testValidateQuery() throws IOException, InterruptedException { QueryBuilder builder = QueryBuilders .boolQuery() // <1> .must(QueryBuilders.queryStringQuery("*:*")) - .filter(QueryBuilders.termQuery("user", "kimchy")); + .filter(QueryBuilders.termQuery("user", "foobar")); request.query(builder); // <2> // end::indices-validate-query-request-query diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java index 0e1e5b11357e1..5d9d55e97d391 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java @@ -102,7 +102,7 @@ public void testBool() { public void testBoosting() { // tag::boosting boostingQuery( - termQuery("name","kimchy"), // <1> + termQuery("name","foobar"), // <1> termQuery("name","dadoonet")) // <2> .negativeBoost(0.2f); // <3> // end::boosting @@ -111,14 +111,14 @@ public void testBoosting() { public void testCommonTerms() { // tag::common_terms commonTermsQuery("name", // <1> - "kimchy"); // <2> + "foobar"); // <2> // end::common_terms } public void testConstantScore() { // tag::constant_score constantScoreQuery( - termQuery("name","kimchy")) // <1> + termQuery("name","foobar")) // <1> .boost(2.0f); // <2> // end::constant_score } @@ -126,7 +126,7 @@ public void testConstantScore() { public void testDisMax() { // tag::dis_max disMaxQuery() - .add(termQuery("name", "kimchy")) // <1> + .add(termQuery("name", "foobar")) // <1> .add(termQuery("name", "opensearch")) // <2> .boost(1.2f) // <3> .tieBreaker(0.7f); // <4> @@ -143,7 +143,7 @@ public void testFunctionScore() { // tag::function_score FilterFunctionBuilder[] functions = { new FunctionScoreQueryBuilder.FilterFunctionBuilder( - matchQuery("name", "kimchy"), // <1> + matchQuery("name", "foobar"), // <1> randomFunction()), // <2> new FunctionScoreQueryBuilder.FilterFunctionBuilder( exponentialDecayFunction("age", 0L, 1L)) // <3> @@ -156,7 +156,7 @@ public void testFuzzy() { // tag::fuzzy fuzzyQuery( "name", // <1> - "kimchy"); // <2> + "foobar"); // <2> // end::fuzzy } @@ -251,7 +251,7 @@ public void testMatch() { // tag::match matchQuery( "name", // <1> - "kimchy opensearch"); // <2> + "foobar opensearch"); // <2> // end::match } @@ -269,7 +269,7 @@ public void testMoreLikeThis() { public void testMultiMatch() { // tag::multi_match multiMatchQuery( - "kimchy opensearch", // <1> + "foobar opensearch", // <1> "user", "message"); // <2> // end::multi_match } @@ -295,7 +295,7 @@ public void testPrefix() { public void testQueryString() { // tag::query_string - queryStringQuery("+kimchy -opensearch"); + queryStringQuery("+foobar -opensearch"); // end::query_string } @@ -344,7 +344,7 @@ public void testScript() { public void testSimpleQueryString() { // tag::simple_query_string - simpleQueryStringQuery("+kimchy -opensearch"); + simpleQueryStringQuery("+foobar -opensearch"); // end::simple_query_string } @@ -361,7 +361,7 @@ public void testSpanContaining() { public void testSpanFirst() { // tag::span_first spanFirstQuery( - spanTermQuery("user", "kimchy"), // <1> + spanTermQuery("user", "foobar"), // <1> 3 // <2> ); // end::span_first @@ -405,7 +405,7 @@ public void testSpanTerm() { // tag::span_term spanTermQuery( "user", // <1> - "kimchy"); // <2> + "foobar"); // <2> // end::span_term } @@ -423,7 +423,7 @@ public void testTerm() { // tag::term termQuery( "name", // <1> - "kimchy"); // <2> + "foobar"); // <2> // end::term } @@ -450,7 +450,7 @@ public void testWildcard() { public void testWrapper() { // tag::wrapper - String query = "{\"term\": {\"user\": \"kimchy\"}}"; // <1> + String query = "{\"term\": {\"user\": \"foobar\"}}"; // <1> wrapperQuery(query); // end::wrapper } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java index ae3e031040002..1f155d6eca671 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java @@ -161,7 +161,7 @@ public void testSearch() throws Exception { { // tag::search-source-basics SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); // <1> - sourceBuilder.query(QueryBuilders.termQuery("user", "kimchy")); // <2> + sourceBuilder.query(QueryBuilders.termQuery("user", "foobar")); // <2> sourceBuilder.from(0); // <3> sourceBuilder.size(5); // <4> sourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS)); // <5> @@ -279,7 +279,7 @@ public void testBuildingSearchQueries() { RestHighLevelClient client = highLevelClient(); { // tag::search-query-builder-ctor - MatchQueryBuilder matchQueryBuilder = new MatchQueryBuilder("user", "kimchy"); // <1> + MatchQueryBuilder matchQueryBuilder = new MatchQueryBuilder("user", "foobar"); // <1> // end::search-query-builder-ctor // tag::search-query-builder-options matchQueryBuilder.fuzziness(Fuzziness.AUTO); // <1> @@ -289,7 +289,7 @@ public void testBuildingSearchQueries() { } { // tag::search-query-builders - QueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("user", "kimchy") + QueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("user", "foobar") .fuzziness(Fuzziness.AUTO) .prefixLength(3) .maxExpansions(10); @@ -382,7 +382,7 @@ public void testSearchRequestSuggestions() throws IOException { RestHighLevelClient client = highLevelClient(); { BulkRequest request = new BulkRequest(); - request.add(new IndexRequest("posts").id("1").source(XContentType.JSON, "user", "kimchy")); + request.add(new IndexRequest("posts").id("1").source(XContentType.JSON, "user", "foobar")); request.add(new IndexRequest("posts").id("2").source(XContentType.JSON, "user", "javanna")); request.add(new IndexRequest("posts").id("3").source(XContentType.JSON, "user", "tlrx")); request.add(new IndexRequest("posts").id("4").source(XContentType.JSON, "user", "cbuescher")); @@ -415,7 +415,7 @@ public void testSearchRequestSuggestions() throws IOException { // end::search-request-suggestion-get assertEquals(1, termSuggestion.getEntries().size()); assertEquals(1, termSuggestion.getEntries().get(0).getOptions().size()); - assertEquals("kimchy", termSuggestion.getEntries().get(0).getOptions().get(0).getText().string()); + assertEquals("foobar", termSuggestion.getEntries().get(0).getOptions().get(0).getText().string()); } } } @@ -427,13 +427,13 @@ public void testSearchRequestHighlighting() throws IOException { BulkRequest request = new BulkRequest(); request.add(new IndexRequest("posts").id("1") .source(XContentType.JSON, "title", "In which order are my OpenSearch queries executed?", "user", - Arrays.asList("kimchy", "luca"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "luca"), "innerObject", Collections.singletonMap("key", "value"))); request.add(new IndexRequest("posts").id("2") .source(XContentType.JSON, "title", "Current status and upcoming changes in OpenSearch", "user", - Arrays.asList("kimchy", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); request.add(new IndexRequest("posts").id("3") .source(XContentType.JSON, "title", "The Future of Federated Search in OpenSearch", "user", - Arrays.asList("kimchy", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT); assertSame(RestStatus.OK, bulkResponse.status()); @@ -454,7 +454,7 @@ public void testSearchRequestHighlighting() throws IOException { // end::search-request-highlighting searchSourceBuilder.query(QueryBuilders.boolQuery() .should(matchQuery("title", "OpenSearch")) - .should(matchQuery("user", "kimchy"))); + .should(matchQuery("user", "foobar"))); searchRequest.source(searchSourceBuilder); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); { @@ -477,7 +477,7 @@ public void testSearchRequestHighlighting() throws IOException { highlight = highlightFields.get("user"); fragments = highlight.fragments(); assertEquals(1, fragments.length); - assertThat(fragments[0].string(), containsString("kimchy")); + assertThat(fragments[0].string(), containsString("foobar")); } } @@ -1128,7 +1128,7 @@ public void testRankEval() throws Exception { List ratedDocs = new ArrayList<>(); ratedDocs.add(new RatedDocument("posts", "1", 1)); // <2> SearchSourceBuilder searchQuery = new SearchSourceBuilder(); - searchQuery.query(QueryBuilders.matchQuery("user", "kimchy"));// <3> + searchQuery.query(QueryBuilders.matchQuery("user", "foobar"));// <3> RatedRequest ratedRequest = // <4> new RatedRequest("kimchy_query", ratedDocs, searchQuery); List ratedRequests = Arrays.asList(ratedRequest); @@ -1198,7 +1198,7 @@ public void testMultiSearch() throws Exception { MultiSearchRequest request = new MultiSearchRequest(); // <1> SearchRequest firstSearchRequest = new SearchRequest(); // <2> SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); - searchSourceBuilder.query(QueryBuilders.matchQuery("user", "kimchy")); + searchSourceBuilder.query(QueryBuilders.matchQuery("user", "foobar")); firstSearchRequest.source(searchSourceBuilder); request.add(firstSearchRequest); // <3> SearchRequest secondSearchRequest = new SearchRequest(); // <4> @@ -1281,16 +1281,16 @@ private void indexSearchTestData() throws IOException { BulkRequest bulkRequest = new BulkRequest(); bulkRequest.add(new IndexRequest("posts").id("1") .source(XContentType.JSON, "id", 1, "title", "In which order are my OpenSearch queries executed?", "user", - Arrays.asList("kimchy", "luca"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "luca"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("posts").id("2") .source(XContentType.JSON, "id", 2, "title", "Current status and upcoming changes in OpenSearch", "user", - Arrays.asList("kimchy", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("posts").id("3") .source(XContentType.JSON, "id", 3, "title", "The Future of Federated Search in OpenSearch", "user", - Arrays.asList("kimchy", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("authors").id("1") - .source(XContentType.JSON, "id", 1, "user", "kimchy")); + .source(XContentType.JSON, "id", 1, "user", "foobar")); bulkRequest.add(new IndexRequest("contributors").id("1") .source(XContentType.JSON, "id", 1, "user", "tanguy")); @@ -1326,7 +1326,7 @@ public void testCount() throws Exception { { // tag::count-source-basics SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); // <1> - sourceBuilder.query(QueryBuilders.termQuery("user", "kimchy")); // <2> + sourceBuilder.query(QueryBuilders.termQuery("user", "foobar")); // <2> // end::count-source-basics // tag::count-source-setter @@ -1402,16 +1402,16 @@ private static void indexCountTestData() throws IOException { BulkRequest bulkRequest = new BulkRequest(); bulkRequest.add(new IndexRequest("blog").id("1") .source(XContentType.JSON, "title", "Doubling Down on Open?", "user", - Collections.singletonList("kimchy"), "innerObject", Collections.singletonMap("key", "value"))); + Collections.singletonList("foobar"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("blog").id("2") .source(XContentType.JSON, "title", "Swiftype Joins Forces with Elastic", "user", - Arrays.asList("kimchy", "matt"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "matt"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("blog").id("3") .source(XContentType.JSON, "title", "On Net Neutrality", "user", - Arrays.asList("tyler", "kimchy"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("tyler", "foobar"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("author").id("1") - .source(XContentType.JSON, "user", "kimchy")); + .source(XContentType.JSON, "user", "foobar")); bulkRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); diff --git a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/SynonymsAnalysisTests.java b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/SynonymsAnalysisTests.java index 20d675a69ad9e..1d84d207e53a2 100644 --- a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/SynonymsAnalysisTests.java +++ b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/SynonymsAnalysisTests.java @@ -74,16 +74,16 @@ public void testSynonymsAnalysis() throws IOException { IndexSettings idxSettings = IndexSettingsModule.newIndexSettings("index", settings); indexAnalyzers = createTestAnalysis(idxSettings, settings, new CommonAnalysisPlugin()).indexAnalyzers; - match("synonymAnalyzer", "kimchy is the dude abides", "shay is the elasticsearch man!"); - match("synonymAnalyzer_file", "kimchy is the dude abides", "shay is the elasticsearch man!"); + match("synonymAnalyzer", "foobar is the dude abides", "fred is the opensearch man!"); + match("synonymAnalyzer_file", "foobar is the dude abides", "fred is the opensearch man!"); match("synonymAnalyzerWordnet", "abstain", "abstain refrain desist"); match("synonymAnalyzerWordnet_file", "abstain", "abstain refrain desist"); - match("synonymAnalyzerWithsettings", "kimchy", "sha hay"); - match("synonymAnalyzerWithStopAfterSynonym", "kimchy is the dude abides , stop", "shay is the elasticsearch man! ,"); - match("synonymAnalyzerWithStopBeforeSynonym", "kimchy is the dude abides , stop", "shay is the elasticsearch man! ,"); - match("synonymAnalyzerWithStopSynonymAfterSynonym", "kimchy is the dude abides", "shay is the man!"); - match("synonymAnalyzerExpand", "kimchy is the dude abides", "kimchy shay is the dude elasticsearch abides man!"); - match("synonymAnalyzerExpandWithStopAfterSynonym", "kimchy is the dude abides", "shay is the dude abides man!"); + match("synonymAnalyzerWithsettings", "foobar", "fre red"); + match("synonymAnalyzerWithStopAfterSynonym", "foobar is the dude abides , stop", "fred is the opensearch man! ,"); + match("synonymAnalyzerWithStopBeforeSynonym", "foobar is the dude abides , stop", "fred is the opensearch man! ,"); + match("synonymAnalyzerWithStopSynonymAfterSynonym", "foobar is the dude abides", "fred is the man!"); + match("synonymAnalyzerExpand", "foobar is the dude abides", "foobar fred is the dude opensearch abides man!"); + match("synonymAnalyzerExpandWithStopAfterSynonym", "foobar is the dude abides", "fred is the dude abides man!"); } @@ -92,9 +92,9 @@ public void testSynonymWordDeleteByAnalyzer() throws IOException { .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) .put("path.home", createTempDir().toString()) .put("index.analysis.filter.synonym.type", "synonym") - .putList("index.analysis.filter.synonym.synonyms", "kimchy => shay", "dude => elasticsearch", "abides => man!") + .putList("index.analysis.filter.synonym.synonyms", "foobar => fred", "dude => opensearch", "abides => man!") .put("index.analysis.filter.stop_within_synonym.type", "stop") - .putList("index.analysis.filter.stop_within_synonym.stopwords", "kimchy", "elasticsearch") + .putList("index.analysis.filter.stop_within_synonym.stopwords", "foobar", "opensearch") .put("index.analysis.analyzer.synonymAnalyzerWithStopSynonymBeforeSynonym.tokenizer", "whitespace") .putList("index.analysis.analyzer.synonymAnalyzerWithStopSynonymBeforeSynonym.filter", "stop_within_synonym","synonym") .build(); @@ -113,9 +113,9 @@ public void testExpandSynonymWordDeleteByAnalyzer() throws IOException { .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) .put("path.home", createTempDir().toString()) .put("index.analysis.filter.synonym_expand.type", "synonym") - .putList("index.analysis.filter.synonym_expand.synonyms", "kimchy, shay", "dude, elasticsearch", "abides, man!") + .putList("index.analysis.filter.synonym_expand.synonyms", "foobar, fred", "dude, opensearch", "abides, man!") .put("index.analysis.filter.stop_within_synonym.type", "stop") - .putList("index.analysis.filter.stop_within_synonym.stopwords", "kimchy", "elasticsearch") + .putList("index.analysis.filter.stop_within_synonym.stopwords", "foobar", "opensearch") .put("index.analysis.analyzer.synonymAnalyzerExpandWithStopBeforeSynonym.tokenizer", "whitespace") .putList("index.analysis.analyzer.synonymAnalyzerExpandWithStopBeforeSynonym.filter", "stop_within_synonym","synonym_expand") .build(); diff --git a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.json b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.json index b0d04b71cd542..7360064970127 100644 --- a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.json +++ b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.json @@ -54,7 +54,7 @@ "synonym":{ "type":"synonym", "synonyms":[ - "kimchy => shay", + "foobar => fred", "dude => opensearch", "abides => man!" ] @@ -80,7 +80,7 @@ "synonymWithTokenizerSettings":{ "type":"synonym", "synonyms":[ - "kimchy => shay" + "foobar => fred" ] }, "stop":{ @@ -89,12 +89,12 @@ }, "stop_within_synonym":{ "type": "stop", - "stopwords":["kimchy", "opensearch"] + "stopwords":["foobar", "opensearch"] }, "synonym_expand":{ "type":"synonym", "synonyms":[ - "kimchy , shay", + "foobar , fred", "dude , opensearch", "abides , man!" ] diff --git a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.txt b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.txt index ef4b225627002..393cb7e945024 100644 --- a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.txt +++ b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/synonyms.txt @@ -1,3 +1,3 @@ -kimchy => shay -dude => elasticsearch +foobar => fred +dude => opensearch abides => man! diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_analyze.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_analyze.yml index f26f85fbf411c..6cf67b3d060e9 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_analyze.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_analyze.yml @@ -68,7 +68,7 @@ filter: synonym: type: synonym - synonyms: ["kimchy => shay"] + synonyms: ["foobar => fred"] - do: indices.analyze: @@ -76,10 +76,10 @@ body: tokenizer: trigram filter: [synonym] - text: kimchy + text: foobar - length: { tokens: 2 } - - match: { tokens.0.token: sha } - - match: { tokens.1.token: hay } + - match: { tokens.0.token: fre } + - match: { tokens.1.token: red } --- "Custom normalizer in request": diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml index c87846c3b8f93..f0f8765ab5130 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml @@ -17,19 +17,19 @@ filter: synonym: type: synonym - synonyms: ["

kimchy

=> shay", "dude => opensearch", "abides => man!"] + synonyms: ["

foobar

=> fred", "dude => opensearch", "abides => man!"] - do: indices.analyze: index: test_synonym_with_charfilter body: analyzer: "synonymAnalyzerWithCharfilter" - text: "kimchy is the dude abides" + text: "foobar is the dude abides" - length: { tokens: 5 } - - match: { tokens.0.token: shay } + - match: { tokens.0.token: fred } - match: { tokens.1.token: is } - match: { tokens.2.token: the } - - match: { tokens.3.token: elasticsearch } + - match: { tokens.3.token: opensearch } - match: { tokens.4.token: man! } --- diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/delete_by_query/10_basic.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/delete_by_query/10_basic.yml index 3c52ce542006f..3d9821fb7867c 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/delete_by_query/10_basic.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/delete_by_query/10_basic.yml @@ -254,7 +254,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -270,7 +270,7 @@ body: query: match: - user: kimchy + user: foobar - match: {deleted: 1} - match: {version_conflicts: 0} - match: {batches: 1} @@ -294,12 +294,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -339,12 +339,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -382,12 +382,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -425,12 +425,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -441,7 +441,7 @@ max_docs: 1 query: match: - user: "kimchy" + user: "foobar" - match: {deleted: 1} - match: {version_conflicts: 0} diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml index ee920a669a504..7c33f1b75b286 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml @@ -4,7 +4,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -38,7 +38,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -87,7 +87,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -114,8 +114,8 @@ get: index: new_twitter id: 1 - routing: kimchy - - match: { _routing: kimchy } + routing: foobar + - match: { _routing: foobar } - do: get: @@ -130,7 +130,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -149,7 +149,7 @@ index: new_twitter script: lang: painless - source: if (ctx._source.user == "kimchy") {ctx._source.user = "not" + ctx._source.user} else {ctx.op = "noop"} + source: if (ctx._source.user == "foobar") {ctx._source.user = "not" + ctx._source.user} else {ctx.op = "noop"} - match: {created: 1} - match: {noops: 1} @@ -184,7 +184,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -219,14 +219,14 @@ id: 1 version: 1 version_type: external - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: new_twitter id: 1 version: 1 version_type: external - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -261,12 +261,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: new_twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -300,7 +300,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -319,7 +319,7 @@ index: new_twitter script: lang: painless - source: if (ctx._source.user == "kimchy") {ctx._index = 'other_new_twitter'} + source: if (ctx._source.user == "foobar") {ctx._index = 'other_new_twitter'} - match: {created: 2} - match: {noops: 0} @@ -330,7 +330,7 @@ body: query: match: - user: kimchy + user: foobar - match: { hits.total: 1 } - do: @@ -423,7 +423,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/10_basic.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/10_basic.yml index e220f164f26ac..5d663675f6121 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/10_basic.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/10_basic.yml @@ -198,7 +198,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -213,7 +213,7 @@ body: query: match: - user: kimchy + user: foobar - match: {updated: 1} - match: {version_conflicts: 0} - match: {batches: 1} @@ -231,12 +231,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -263,12 +263,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -293,12 +293,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -323,12 +323,12 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter id: 2 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -339,7 +339,7 @@ max_docs: 1 query: match: - user: "kimchy" + user: "foobar" - match: {updated: 1} - match: {version_conflicts: 0} - match: {batches: 1} diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml index 0c297b13dbd81..a220356951217 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml @@ -4,7 +4,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -35,7 +35,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -63,7 +63,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -79,7 +79,7 @@ body: script: lang: painless - source: if (ctx._source.user == "kimchy") {ctx._source.user = "not" + ctx._source.user} else {ctx.op = "noop"} + source: if (ctx._source.user == "foobar") {ctx._source.user = "not" + ctx._source.user} else {ctx.op = "noop"} - match: {updated: 1} - match: {noops: 1} @@ -109,7 +109,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -136,7 +136,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -155,7 +155,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} @@ -311,7 +311,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: index: index: twitter @@ -328,7 +328,7 @@ body: script: lang: painless - source: if (ctx._source.user == "kimchy") {ctx.op = "index"} else {ctx.op = "junk"} + source: if (ctx._source.user == "foobar") {ctx.op = "index"} else {ctx.op = "junk"} - match: { error.reason: 'Operation type [junk] not allowed, only [noop, index, delete] are allowed' } @@ -418,7 +418,7 @@ index: index: twitter id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} diff --git a/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java b/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java index 427ec16911410..2ac7c1e8decaf 100644 --- a/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java +++ b/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java @@ -187,7 +187,7 @@ public void testHtmlDocument() throws Exception { assertThat(attachmentData.get("language"), is("en")); assertThat(attachmentData.get("content"), is(notNullValue())); assertThat(attachmentData.get("content_length"), is(notNullValue())); - assertThat(attachmentData.get("author"), is("kimchy")); + assertThat(attachmentData.get("author"), is("foobar")); assertThat(attachmentData.get("keywords"), is("opensearch,cool,bonsai")); assertThat(attachmentData.get("title"), is("Hello")); assertThat(attachmentData.get("content_type").toString(), containsString("text/html")); diff --git a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithEmptyDateMeta.html b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithEmptyDateMeta.html index 4797e81ad6ba4..00a7cfb73f97c 100644 --- a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithEmptyDateMeta.html +++ b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithEmptyDateMeta.html @@ -4,7 +4,7 @@ Hello - + Hello again. This is a test sentence to check for language detection. diff --git a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithValidDateMeta.html b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithValidDateMeta.html index b47881cbb64dc..a23dfe4ddfd28 100644 --- a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithValidDateMeta.html +++ b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithValidDateMeta.html @@ -4,7 +4,7 @@ Hello - + World diff --git a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithoutDateMeta.html b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithoutDateMeta.html index a7cf8855434eb..160ff130e0746 100644 --- a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithoutDateMeta.html +++ b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/htmlWithoutDateMeta.html @@ -3,7 +3,7 @@ Hello - + World diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml index 0f187cc439016..18929c47a4027 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml @@ -20,7 +20,7 @@ index: twitter type: _doc id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml index 8703eca4a5ae3..e34ca43a62282 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml @@ -20,7 +20,7 @@ index: twitter type: tweet id: 1 - body: { "user": "kimchy" } + body: { "user": "foobar" } - do: indices.refresh: {} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml index bf359a9e8c5ad..98cb73a552001 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml @@ -55,7 +55,7 @@ aliases: test_alias: {} test_blias: { routing: b } - test_clias: { filter: { term: { user: kimchy }}} + test_clias: { filter: { term: { user: foobar }}} - do: indices.get_index_template: @@ -68,7 +68,7 @@ - is_true: index_templates.0.index_template.template.aliases.test_alias - match: {index_templates.0.index_template.template.aliases.test_blias.index_routing: "b" } - match: {index_templates.0.index_template.template.aliases.test_blias.search_routing: "b" } - - match: {index_templates.0.index_template.template.aliases.test_clias.filter.term.user: "kimchy" } + - match: {index_templates.0.index_template.template.aliases.test_clias.filter.term.user: "foobar" } --- "Put index template with 'create' flag": diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_template/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_template/10_basic.yml index 05bca61811a96..f7a83442ca2e2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_template/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_template/10_basic.yml @@ -88,7 +88,7 @@ aliases: test_alias: {} test_blias: { routing: b } - test_clias: { filter: { term: { user: kimchy }}} + test_clias: { filter: { term: { user: foobar }}} - do: indices.get_template: @@ -99,7 +99,7 @@ - is_true: test.aliases.test_alias - match: { test.aliases.test_blias.index_routing: "b" } - match: { test.aliases.test_blias.search_routing: "b" } - - match: { test.aliases.test_clias.filter.term.user: "kimchy" } + - match: { test.aliases.test_clias.filter.term.user: "foobar" } --- "Put template create": diff --git a/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java b/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java index eede37a67f279..a300d58397a3a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java @@ -204,16 +204,16 @@ public void testFilteringAliases() throws Exception { ensureGreen(); - logger.info("--> aliasing index [test] with [alias1] and filter [user:kimchy]"); - QueryBuilder filter = termQuery("user", "kimchy"); + logger.info("--> aliasing index [test] with [alias1] and filter [user:foobar]"); + QueryBuilder filter = termQuery("user", "foobar"); assertAliasesVersionIncreases("test", () -> assertAcked(admin().indices().prepareAliases().addAlias("test", "alias1", filter))); // For now just making sure that filter was stored with the alias - logger.info("--> making sure that filter was stored with alias [alias1] and filter [user:kimchy]"); + logger.info("--> making sure that filter was stored with alias [alias1] and filter [user:foobar]"); ClusterState clusterState = admin().cluster().prepareState().get().getState(); IndexMetadata indexMd = clusterState.metadata().index("test"); assertThat(indexMd.getAliases().get("alias1").filter().string(), - equalTo("{\"term\":{\"user\":{\"value\":\"kimchy\",\"boost\":1.0}}}")); + equalTo("{\"term\":{\"user\":{\"value\":\"foobar\",\"boost\":1.0}}}")); } diff --git a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java index 52c6838813263..952a836e58b34 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java @@ -553,14 +553,14 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " \"name\": \"read\",\n" + " \"user\": [\n" + " {\"username\": \"matt\", \"id\": 1},\n" - + " {\"username\": \"shay\", \"id\": 2},\n" + + " {\"username\": \"fred\", \"id\": 2},\n" + " {\"username\": \"adrien\", \"id\": 3}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"write\",\n" + " \"user\": [\n" - + " {\"username\": \"shay\", \"id\": 2},\n" + + " {\"username\": \"fred\", \"id\": 2},\n" + " {\"username\": \"adrien\", \"id\": 3}\n" + " ]\n" + " }\n" @@ -573,19 +573,19 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " \"name\": \"read\",\n" + " \"user\": [\n" + " {\"username\": \"jim\", \"id\": 4},\n" - + " {\"username\": \"shay\", \"id\": 2}\n" + + " {\"username\": \"fred\", \"id\": 2}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"write\",\n" + " \"user\": [\n" - + " {\"username\": \"shay\", \"id\": 2}\n" + + " {\"username\": \"fred\", \"id\": 2}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"execute\",\n" + " \"user\": [\n" - + " {\"username\": \"shay\", \"id\": 2}\n" + + " {\"username\": \"fred\", \"id\": 2}\n" + " ]\n" + " }\n" + " ]\n" @@ -640,7 +640,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + "}", XContentType.JSON).get(); refresh(); - // access id = 1, read, max value, asc, should use matt and shay + // access id = 1, read, max value, asc, should use matt and fred SearchResponse searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -660,7 +660,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("2")); assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("matt")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("1")); - assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("shay")); + assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("fred")); // access id = 1, read, min value, asc, should now use adrien and luca diff --git a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java index a5070ac62785c..271612fcbcd5b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java @@ -920,8 +920,8 @@ public void testBoolQueryMinShouldMatchBiggerThanNumberOfShouldClauses() throws public void testFuzzyQueryString() { createIndex("test"); - client().prepareIndex("test", "type1", "1").setSource("str", "kimchy", "date", "2012-02-01", "num", 12).get(); - client().prepareIndex("test", "type1", "2").setSource("str", "shay", "date", "2012-02-05", "num", 20).get(); + client().prepareIndex("test", "type1", "1").setSource("str", "foobar", "date", "2012-02-01", "num", 12).get(); + client().prepareIndex("test", "type1", "2").setSource("str", "fred", "date", "2012-02-05", "num", 20).get(); refresh(); SearchResponse searchResponse = client().prepareSearch().setQuery(queryStringQuery("str:kimcy~1")).get(); @@ -951,8 +951,8 @@ public void testQuotedQueryStringWithBoost() throws InterruptedException { public void testSpecialRangeSyntaxInQueryString() { createIndex("test"); - client().prepareIndex("test", "type1", "1").setSource("str", "kimchy", "date", "2012-02-01", "num", 12).get(); - client().prepareIndex("test", "type1", "2").setSource("str", "shay", "date", "2012-02-05", "num", 20).get(); + client().prepareIndex("test", "type1", "1").setSource("str", "foobar", "date", "2012-02-01", "num", 12).get(); + client().prepareIndex("test", "type1", "2").setSource("str", "fred", "date", "2012-02-05", "num", 20).get(); refresh(); SearchResponse searchResponse = client().prepareSearch().setQuery(queryStringQuery("num:>19")).get(); diff --git a/server/src/internalClusterTest/java/org/opensearch/search/scroll/SearchScrollIT.java b/server/src/internalClusterTest/java/org/opensearch/search/scroll/SearchScrollIT.java index 282be77b800df..b9693beb134cb 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/scroll/SearchScrollIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/scroll/SearchScrollIT.java @@ -213,7 +213,7 @@ public void testScrollAndUpdateIndex() throws Exception { for (int i = 0; i < 500; i++) { client().prepareIndex("test", "tweet", Integer.toString(i)).setSource( - jsonBuilder().startObject().field("user", "kimchy").field("postDate", System.currentTimeMillis()) + jsonBuilder().startObject().field("user", "foobar").field("postDate", System.currentTimeMillis()) .field("message", "test").endObject()).get(); } @@ -230,7 +230,7 @@ public void testScrollAndUpdateIndex() throws Exception { equalTo(0L)); SearchResponse searchResponse = client().prepareSearch() - .setQuery(queryStringQuery("user:kimchy")) + .setQuery(queryStringQuery("user:foobar")) .setSize(35) .setScroll(TimeValue.timeValueMinutes(2)) .addSort("postDate", SortOrder.ASC) diff --git a/server/src/internalClusterTest/java/org/opensearch/validate/SimpleValidateQueryIT.java b/server/src/internalClusterTest/java/org/opensearch/validate/SimpleValidateQueryIT.java index 6235d23180c7a..200b95590bde0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/validate/SimpleValidateQueryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/validate/SimpleValidateQueryIT.java @@ -269,7 +269,7 @@ public void testIrrelevantPropertiesBeforeQuery() throws IOException { refresh(); assertThat(client().admin().indices().prepareValidateQuery("test").setQuery(QueryBuilders.wrapperQuery( - new BytesArray("{\"foo\": \"bar\", \"query\": {\"term\" : { \"user\" : \"kimchy\" }}}"))).get().isValid(), equalTo(false)); + new BytesArray("{\"foo\": \"bar\", \"query\": {\"term\" : { \"user\" : \"foobar\" }}}"))).get().isValid(), equalTo(false)); } public void testIrrelevantPropertiesAfterQuery() throws IOException { @@ -278,7 +278,7 @@ public void testIrrelevantPropertiesAfterQuery() throws IOException { refresh(); assertThat(client().admin().indices().prepareValidateQuery("test").setQuery(QueryBuilders.wrapperQuery( - new BytesArray("{\"query\": {\"term\" : { \"user\" : \"kimchy\" }}, \"foo\": \"bar\"}"))).get().isValid(), equalTo(false)); + new BytesArray("{\"query\": {\"term\" : { \"user\" : \"foobar\" }}, \"foo\": \"bar\"}"))).get().isValid(), equalTo(false)); } private static void assertExplanation(QueryBuilder queryBuilder, Matcher matcher, boolean withRewrite) { diff --git a/server/src/test/java/org/opensearch/cluster/metadata/ToAndFromJsonMetadataTests.java b/server/src/test/java/org/opensearch/cluster/metadata/ToAndFromJsonMetadataTests.java index a73ffeee5d545..91e44590d4dd5 100644 --- a/server/src/test/java/org/opensearch/cluster/metadata/ToAndFromJsonMetadataTests.java +++ b/server/src/test/java/org/opensearch/cluster/metadata/ToAndFromJsonMetadataTests.java @@ -72,7 +72,7 @@ public void testSimpleJsonFromAndTo() throws IOException { .put("setting1", "value1") .put("setting2", "value2")) .putAlias(newAliasMetadataBuilder("alias-bar1")) - .putAlias(newAliasMetadataBuilder("alias-bar2").filter("{\"term\":{\"user\":\"kimchy\"}}")) + .putAlias(newAliasMetadataBuilder("alias-bar2").filter("{\"term\":{\"user\":\"foobar\"}}")) .putAlias(newAliasMetadataBuilder("alias-bar3").routing("routing-bar"))) .put("component_template", new ComponentTemplate( new Template(Settings.builder().put("setting", "value").build(), @@ -107,7 +107,7 @@ public void testSimpleJsonFromAndTo() throws IOException { .put("setting1", "value1") .put("setting2", "value2")) .putAlias(newAliasMetadataBuilder("alias-bar1")) - .putAlias(newAliasMetadataBuilder("alias-bar2").filter("{\"term\":{\"user\":\"kimchy\"}}")) + .putAlias(newAliasMetadataBuilder("alias-bar2").filter("{\"term\":{\"user\":\"foobar\"}}")) .putAlias(newAliasMetadataBuilder("alias-bar3").routing("routing-bar"))) .put(idx1, false) .put(idx2, false) @@ -133,7 +133,7 @@ public void testSimpleJsonFromAndTo() throws IOException { assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar1").alias(), equalTo("alias-bar1")); assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar2").alias(), equalTo("alias-bar2")); assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar2").filter().string(), - equalTo("{\"term\":{\"user\":\"kimchy\"}}")); + equalTo("{\"term\":{\"user\":\"foobar\"}}")); assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar3").alias(), equalTo("alias-bar3")); assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar3").indexRouting(), equalTo("routing-bar")); assertThat(parsedMetadata.templates().get("foo").aliases().get("alias-bar3").searchRouting(), equalTo("routing-bar")); diff --git a/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java b/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java index 676b6ab8903c0..45453b8642bc7 100644 --- a/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java @@ -997,13 +997,13 @@ public void testSimpleMapper() throws Exception { Document doc = docMapper.parse(source(b -> { b.startObject("name"); { - b.field("first", "shay"); - b.field("last", "banon"); + b.field("first", "fred"); + b.field("last", "quxx"); } b.endObject(); })).rootDoc(); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("shay")); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("fred")); } public void testParseToJsonAndParse() throws Exception { @@ -1017,7 +1017,7 @@ public void testParseToJsonAndParse() throws Exception { BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/opensearch/index/mapper/simple/test1.json")); Document doc = builtDocMapper.parse(new SourceToParse("test", "_doc", "1", json, XContentType.JSON)).rootDoc(); assertThat(doc.getBinaryValue(builtDocMapper.idFieldMapper().name()), equalTo(Uid.encodeId("1"))); - assertThat(doc.get(builtDocMapper.mappers().getMapper("name.first").name()), equalTo("shay")); + assertThat(doc.get(builtDocMapper.mappers().getMapper("name.first").name()), equalTo("fred")); } public void testSimpleParser() throws Exception { @@ -1029,7 +1029,7 @@ public void testSimpleParser() throws Exception { BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/opensearch/index/mapper/simple/test1.json")); Document doc = docMapper.parse(new SourceToParse("test", "_doc", "1", json, XContentType.JSON)).rootDoc(); assertThat(doc.getBinaryValue(docMapper.idFieldMapper().name()), equalTo(Uid.encodeId("1"))); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("shay")); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("fred")); } public void testSimpleParserNoTypeNoId() throws Exception { @@ -1038,7 +1038,7 @@ public void testSimpleParserNoTypeNoId() throws Exception { BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/opensearch/index/mapper/simple/test1-notype-noid.json")); Document doc = docMapper.parse(new SourceToParse("test", "_doc", "1", json, XContentType.JSON)).rootDoc(); assertThat(doc.getBinaryValue(docMapper.idFieldMapper().name()), equalTo(Uid.encodeId("1"))); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("shay")); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").name()), equalTo("fred")); } public void testAttributes() throws Exception { diff --git a/server/src/test/java/org/opensearch/index/query/BoolQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/BoolQueryBuilderTests.java index 5849bbf4ca0f5..4d6a10c62835d 100644 --- a/server/src/test/java/org/opensearch/index/query/BoolQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/BoolQueryBuilderTests.java @@ -226,7 +226,7 @@ public void testFromJson() throws IOException { " \"must\" : [ {" + " \"term\" : {" + " \"user\" : {" + - " \"value\" : \"kimchy\"," + + " \"value\" : \"foobar\"," + " \"boost\" : 1.0" + " }" + " }" + @@ -276,7 +276,7 @@ public void testFromJson() throws IOException { assertEquals(query, 42, queryBuilder.boost, 0.00001); assertEquals(query, "23", queryBuilder.minimumShouldMatch()); - assertEquals(query, "kimchy", ((TermQueryBuilder)queryBuilder.must().get(0)).value()); + assertEquals(query, "foobar", ((TermQueryBuilder)queryBuilder.must().get(0)).value()); } public void testMinimumShouldMatchNumber() throws IOException { diff --git a/server/src/test/java/org/opensearch/index/query/ConstantScoreQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/ConstantScoreQueryBuilderTests.java index 5b7712df410d9..c93bd6479d969 100644 --- a/server/src/test/java/org/opensearch/index/query/ConstantScoreQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/ConstantScoreQueryBuilderTests.java @@ -90,7 +90,7 @@ public void testFromJson() throws IOException { " \"constant_score\" : {\n" + " \"filter\" : {\n" + " \"terms\" : {\n" + - " \"user\" : [ \"kimchy\", \"opensearch\" ],\n" + + " \"user\" : [ \"foobar\", \"opensearch\" ],\n" + " \"boost\" : 42.0\n" + " }\n" + " },\n" + diff --git a/server/src/test/java/org/opensearch/index/query/SpanFirstQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/SpanFirstQueryBuilderTests.java index 9f1a8ba67124b..c9bc7fcf17f6e 100644 --- a/server/src/test/java/org/opensearch/index/query/SpanFirstQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/SpanFirstQueryBuilderTests.java @@ -81,7 +81,7 @@ public void testFromJson() throws IOException { " \"match\" : {\n" + " \"span_term\" : {\n" + " \"user\" : {\n" + - " \"value\" : \"kimchy\",\n" + + " \"value\" : \"foobar\",\n" + " \"boost\" : 1.0\n" + " }\n" + " }\n" + @@ -95,7 +95,7 @@ public void testFromJson() throws IOException { checkGeneratedJson(json, parsed); assertEquals(json, 3, parsed.end()); - assertEquals(json, "kimchy", ((SpanTermQueryBuilder) parsed.innerQuery()).value()); + assertEquals(json, "foobar", ((SpanTermQueryBuilder) parsed.innerQuery()).value()); } @@ -106,7 +106,7 @@ public void testFromJsonWithNonDefaultBoostInMatchQuery() { " \"match\" : {\n" + " \"span_term\" : {\n" + " \"user\" : {\n" + - " \"value\" : \"kimchy\",\n" + + " \"value\" : \"foobar\",\n" + " \"boost\" : 2.0\n" + " }\n" + " }\n" + diff --git a/server/src/test/java/org/opensearch/index/query/SpanTermQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/SpanTermQueryBuilderTests.java index 3f4636a164b20..cb6c31dbcff29 100644 --- a/server/src/test/java/org/opensearch/index/query/SpanTermQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/SpanTermQueryBuilderTests.java @@ -94,10 +94,10 @@ public SpanTermQueryBuilder[] createSpanTermQueryBuilders(int amount) { } public void testFromJson() throws IOException { - String json = "{ \"span_term\" : { \"user\" : { \"value\" : \"kimchy\", \"boost\" : 2.0 } }}"; + String json = "{ \"span_term\" : { \"user\" : { \"value\" : \"foobar\", \"boost\" : 2.0 } }}"; SpanTermQueryBuilder parsed = (SpanTermQueryBuilder) parseQuery(json); checkGeneratedJson(json, parsed); - assertEquals(json, "kimchy", parsed.value()); + assertEquals(json, "foobar", parsed.value()); assertEquals(json, 2.0, parsed.boost(), 0.0001); } diff --git a/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java index 8f627649c83b2..bf457993d41b2 100644 --- a/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java @@ -261,7 +261,7 @@ public void testFromJson() throws IOException { String json = "{\n" + " \"terms\" : {\n" + - " \"user\" : [ \"kimchy\", \"opensearch\" ],\n" + + " \"user\" : [ \"foobar\", \"opensearch\" ],\n" + " \"boost\" : 1.0\n" + " }\n" + "}"; diff --git a/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java b/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java index 1eec796359bdf..0c8ce354aeb34 100644 --- a/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java @@ -108,7 +108,7 @@ public static void terminateThreadPool() throws InterruptedException { public void testRestValidateQueryAction() throws Exception { // GIVEN a valid query - final String content = "{\"query\":{\"bool\":{\"must\":{\"term\":{\"user\":\"kimchy\"}}}}}"; + final String content = "{\"query\":{\"bool\":{\"must\":{\"term\":{\"user\":\"foobar\"}}}}}"; final RestRequest request = createRestRequest(content); final FakeRestChannel channel = new FakeRestChannel(request, true, 0); diff --git a/server/src/test/resources/org/opensearch/index/mapper/simple/test1-notype-noid.json b/server/src/test/resources/org/opensearch/index/mapper/simple/test1-notype-noid.json index 2a42bc2444abd..1307d5802e676 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/simple/test1-notype-noid.json +++ b/server/src/test/resources/org/opensearch/index/mapper/simple/test1-notype-noid.json @@ -1,7 +1,7 @@ { "name":{ - "first":"shay", - "last":"banon" + "first":"fred", + "last":"quxx" }, "address":{ "first":{ diff --git a/server/src/test/resources/org/opensearch/index/mapper/simple/test1.json b/server/src/test/resources/org/opensearch/index/mapper/simple/test1.json index 2a42bc2444abd..1307d5802e676 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/simple/test1.json +++ b/server/src/test/resources/org/opensearch/index/mapper/simple/test1.json @@ -1,7 +1,7 @@ { "name":{ - "first":"shay", - "last":"banon" + "first":"fred", + "last":"quxx" }, "address":{ "first":{ From 31f41caf2eadb073416c9582af287e10787fc69c Mon Sep 17 00:00:00 2001 From: Rabi Panda Date: Wed, 24 Mar 2021 16:48:36 -0700 Subject: [PATCH 2/3] A few more renaming Signed-off-by: Rabi Panda --- .../client/documentation/SearchDocumentationIT.java | 6 +++--- .../rest-api-spec/test/reindex/85_scripting.yml | 10 +++++----- .../test/update_by_query/80_scripting.yml | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java index 1f155d6eca671..8979ed3be3e83 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java @@ -1130,7 +1130,7 @@ public void testRankEval() throws Exception { SearchSourceBuilder searchQuery = new SearchSourceBuilder(); searchQuery.query(QueryBuilders.matchQuery("user", "foobar"));// <3> RatedRequest ratedRequest = // <4> - new RatedRequest("kimchy_query", ratedDocs, searchQuery); + new RatedRequest("foobar_query", ratedDocs, searchQuery); List ratedRequests = Arrays.asList(ratedRequest); RankEvalSpec specification = new RankEvalSpec(ratedRequests, metric); // <5> @@ -1148,8 +1148,8 @@ public void testRankEval() throws Exception { Map partialResults = response.getPartialResults(); EvalQueryQuality evalQuality = - partialResults.get("kimchy_query"); // <2> - assertEquals("kimchy_query", evalQuality.getId()); + partialResults.get("foobar_query"); // <2> + assertEquals("foobar_query", evalQuality.getId()); double qualityLevel = evalQuality.metricScore(); // <3> assertEquals(1.0 / 3.0, qualityLevel, 0.0); List hitsAndRatings = evalQuality.getHitsAndRatings(); diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml index 7c33f1b75b286..770f372c210a8 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/85_scripting.yml @@ -29,7 +29,7 @@ body: query: match: - user: otherkimchy + user: otherfoobar - match: { hits.total: 1 } --- @@ -68,7 +68,7 @@ body: query: match: - user: otherkimchy + user: otherfoobar - match: { hits.total: 1 } - do: @@ -160,7 +160,7 @@ body: query: match: - user: notkimchy + user: notfoobar - match: { hits.total: 1 } - do: @@ -252,7 +252,7 @@ body: query: match: - user: otherkimchy + user: otherfoobar - match: { hits.total: 1 } --- @@ -291,7 +291,7 @@ body: query: match: - user: otherkimchy + user: otherfoobar - match: { hits.total: 1 } --- diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml index a220356951217..a8de49d812677 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/update_by_query/80_scripting.yml @@ -26,7 +26,7 @@ body: query: match: - user: notkimchy + user: notfoobar - match: { hits.total: 1 } --- @@ -54,7 +54,7 @@ body: query: match: - user: notkimchy + user: notfoobar - match: { hits.total: 1 } --- @@ -90,7 +90,7 @@ body: query: match: - user: notkimchy + user: notfoobar - match: { hits.total: 1 } - do: From 2ebf0d69c2b43a7ab5f0a344f6fec981b15e2510 Mon Sep 17 00:00:00 2001 From: Rabi Panda Date: Wed, 24 Mar 2021 17:23:08 -0700 Subject: [PATCH 3/3] Update as per PR comment Signed-off-by: Rabi Panda --- .../documentation/CRUDDocumentationIT.java | 2 +- .../QueryDSLDocumentationTests.java | 2 +- .../documentation/SearchDocumentationIT.java | 28 +++++++++---------- .../search/nested/SimpleNestedIT.java | 16 +++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java index b42c5e78de653..a0b2490cb8bb1 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/CRUDDocumentationIT.java @@ -1783,7 +1783,7 @@ public void testMultiTermVectors() throws Exception { CreateIndexResponse authorsResponse = client.indices().create(authorsRequest, RequestOptions.DEFAULT); assertTrue(authorsResponse.isAcknowledged()); client.index(new IndexRequest("index").id("1").source("user", "foobar"), RequestOptions.DEFAULT); - client.index(new IndexRequest("index").id("2").source("user", "s1monw"), RequestOptions.DEFAULT); + client.index(new IndexRequest("index").id("2").source("user", "baz"), RequestOptions.DEFAULT); Response refreshResponse = client().performRequest(new Request("POST", "/authors/_refresh")); assertEquals(200, refreshResponse.getStatusLine().getStatusCode()); diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java index 5d9d55e97d391..faf7710ea5b40 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/QueryDSLDocumentationTests.java @@ -103,7 +103,7 @@ public void testBoosting() { // tag::boosting boostingQuery( termQuery("name","foobar"), // <1> - termQuery("name","dadoonet")) // <2> + termQuery("name","qux")) // <2> .negativeBoost(0.2f); // <3> // end::boosting } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java index 8979ed3be3e83..ca45b0a1b4ce5 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java @@ -383,9 +383,9 @@ public void testSearchRequestSuggestions() throws IOException { { BulkRequest request = new BulkRequest(); request.add(new IndexRequest("posts").id("1").source(XContentType.JSON, "user", "foobar")); - request.add(new IndexRequest("posts").id("2").source(XContentType.JSON, "user", "javanna")); - request.add(new IndexRequest("posts").id("3").source(XContentType.JSON, "user", "tlrx")); - request.add(new IndexRequest("posts").id("4").source(XContentType.JSON, "user", "cbuescher")); + request.add(new IndexRequest("posts").id("2").source(XContentType.JSON, "user", "quxx")); + request.add(new IndexRequest("posts").id("3").source(XContentType.JSON, "user", "quzz")); + request.add(new IndexRequest("posts").id("4").source(XContentType.JSON, "user", "corge")); request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT); assertSame(RestStatus.OK, bulkResponse.status()); @@ -427,13 +427,13 @@ public void testSearchRequestHighlighting() throws IOException { BulkRequest request = new BulkRequest(); request.add(new IndexRequest("posts").id("1") .source(XContentType.JSON, "title", "In which order are my OpenSearch queries executed?", "user", - Arrays.asList("foobar", "luca"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "quxx"), "innerObject", Collections.singletonMap("key", "value"))); request.add(new IndexRequest("posts").id("2") .source(XContentType.JSON, "title", "Current status and upcoming changes in OpenSearch", "user", - Arrays.asList("foobar", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "grault"), "innerObject", Collections.singletonMap("key", "value"))); request.add(new IndexRequest("posts").id("3") .source(XContentType.JSON, "title", "The Future of Federated Search in OpenSearch", "user", - Arrays.asList("foobar", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "quuz"), "innerObject", Collections.singletonMap("key", "value"))); request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT); assertSame(RestStatus.OK, bulkResponse.status()); @@ -984,7 +984,7 @@ public void testExplain() throws Exception { // tag::explain-request ExplainRequest request = new ExplainRequest("contributors", "1"); - request.query(QueryBuilders.termQuery("user", "tanguy")); + request.query(QueryBuilders.termQuery("user", "quuz")); // end::explain-request // tag::explain-request-routing @@ -1028,8 +1028,8 @@ public void testExplain() throws Exception { Map source = getResult.getSource(); // <1> Map fields = getResult.getFields(); // <2> // end::get-result - assertThat(source, equalTo(Collections.singletonMap("user", "tanguy"))); - assertThat(fields.get("user").getValue(), equalTo("tanguy")); + assertThat(source, equalTo(Collections.singletonMap("user", "quuz"))); + assertThat(fields.get("user").getValue(), equalTo("quuz")); // tag::explain-execute-listener ActionListener listener = new ActionListener() { @@ -1203,7 +1203,7 @@ public void testMultiSearch() throws Exception { request.add(firstSearchRequest); // <3> SearchRequest secondSearchRequest = new SearchRequest(); // <4> searchSourceBuilder = new SearchSourceBuilder(); - searchSourceBuilder.query(QueryBuilders.matchQuery("user", "luca")); + searchSourceBuilder.query(QueryBuilders.matchQuery("user", "quxx")); secondSearchRequest.source(searchSourceBuilder); request.add(secondSearchRequest); // end::multi-search-request-basic @@ -1281,18 +1281,18 @@ private void indexSearchTestData() throws IOException { BulkRequest bulkRequest = new BulkRequest(); bulkRequest.add(new IndexRequest("posts").id("1") .source(XContentType.JSON, "id", 1, "title", "In which order are my OpenSearch queries executed?", "user", - Arrays.asList("foobar", "luca"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "quxx"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("posts").id("2") .source(XContentType.JSON, "id", 2, "title", "Current status and upcoming changes in OpenSearch", "user", - Arrays.asList("foobar", "christoph"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "grault"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("posts").id("3") .source(XContentType.JSON, "id", 3, "title", "The Future of Federated Search in OpenSearch", "user", - Arrays.asList("foobar", "tanguy"), "innerObject", Collections.singletonMap("key", "value"))); + Arrays.asList("foobar", "quuz"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("authors").id("1") .source(XContentType.JSON, "id", 1, "user", "foobar")); bulkRequest.add(new IndexRequest("contributors").id("1") - .source(XContentType.JSON, "id", 1, "user", "tanguy")); + .source(XContentType.JSON, "id", 1, "user", "quuz")); bulkRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); diff --git a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java index 952a836e58b34..1798bb80b6bea 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java @@ -602,13 +602,13 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " \"name\": \"read\",\n" + " \"user\": [\n" + " {\"username\": \"matt\", \"id\": 1},\n" - + " {\"username\": \"luca\", \"id\": 5}\n" + + " {\"username\": \"quxx\", \"id\": 5}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"execute\",\n" + " \"user\": [\n" - + " {\"username\": \"luca\", \"id\": 5}\n" + + " {\"username\": \"quxx\", \"id\": 5}\n" + " ]\n" + " }\n" + " ]\n" @@ -663,7 +663,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("fred")); - // access id = 1, read, min value, asc, should now use adrien and luca + // access id = 1, read, min value, asc, should now use adrien and quxx searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -683,9 +683,9 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("1")); assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("adrien")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("2")); - assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("luca")); + assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("quxx")); - // execute, by matt or luca, by user id, sort missing first + // execute, by matt or quxx, by user id, sort missing first searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -694,7 +694,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { .setNestedSort(new NestedSortBuilder("acl.operation") .setFilter(QueryBuilders.termQuery("acl.operation.name", "execute")) .setNestedSort(new NestedSortBuilder("acl.operation.user") - .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "luca"))))) + .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "quxx"))))) .missing("_first") .sortMode(SortMode.MIN) .order(SortOrder.DESC) @@ -716,7 +716,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { .setNestedSort(new NestedSortBuilder("acl.operation") .setFilter(QueryBuilders.termQuery("acl.operation.name", "execute")) .setNestedSort(new NestedSortBuilder("acl.operation.user") - .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "luca"))))) + .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "quxx"))))) .sortMode(SortMode.MIN) .order(SortOrder.DESC) ) @@ -725,7 +725,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertHitCount(searchResponse, 2); assertThat(searchResponse.getHits().getHits().length, equalTo(2)); assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("2")); - assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("luca")); + assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("quxx")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("1")); // missing last }