Skip to content

Commit 6b682c6

Browse files
authored
Migrating to Opensearch v1.2.3 (#32)
* Migrating to Opensearch v1.2.3
1 parent 1d07040 commit 6b682c6

File tree

6 files changed

+77
-127
lines changed

6 files changed

+77
-127
lines changed

elastic-mapping-updater/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@
6767
<artifactId>httpcore</artifactId>
6868
</dependency>
6969
<dependency>
70-
<groupId>org.elasticsearch</groupId>
71-
<artifactId>elasticsearch</artifactId>
70+
<groupId>org.opensearch</groupId>
71+
<artifactId>opensearch</artifactId>
7272
</dependency>
7373
<dependency>
74-
<groupId>org.elasticsearch</groupId>
75-
<artifactId>elasticsearch-x-content</artifactId>
74+
<groupId>org.opensearch</groupId>
75+
<artifactId>opensearch-x-content</artifactId>
7676
</dependency>
7777
<dependency>
78-
<groupId>org.elasticsearch.client</groupId>
79-
<artifactId>elasticsearch-rest-client</artifactId>
78+
<groupId>org.opensearch.client</groupId>
79+
<artifactId>opensearch-rest-client</artifactId>
8080
</dependency>
8181
<dependency>
82-
<groupId>org.elasticsearch.client</groupId>
83-
<artifactId>elasticsearch-rest-high-level-client</artifactId>
82+
<groupId>org.opensearch.client</groupId>
83+
<artifactId>opensearch-rest-high-level-client</artifactId>
8484
</dependency>
8585
<dependency>
8686
<groupId>org.slf4j</groupId>

elastic-mapping-updater/src/main/java/com/github/cafdataprocessing/elastic/tools/ElasticMappingUpdater.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import java.util.stream.Collectors;
3030

3131
import org.apache.commons.lang3.StringUtils;
32-
import org.elasticsearch.client.indices.GetIndexResponse;
33-
import org.elasticsearch.client.indices.IndexTemplateMetadata;
34-
import org.elasticsearch.cluster.metadata.MappingMetadata;
32+
import org.opensearch.client.indices.GetIndexResponse;
33+
import org.opensearch.client.indices.IndexTemplateMetadata;
34+
import org.opensearch.cluster.metadata.MappingMetadata;
3535
import org.slf4j.Logger;
3636
import org.slf4j.LoggerFactory;
3737

elastic-mapping-updater/src/main/java/com/github/cafdataprocessing/elastic/tools/ElasticProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import org.apache.http.auth.UsernamePasswordCredentials;
2222
import org.apache.http.client.CredentialsProvider;
2323
import org.apache.http.impl.client.BasicCredentialsProvider;
24-
import org.elasticsearch.client.RestClient;
25-
import org.elasticsearch.client.RestClientBuilder;
24+
import org.opensearch.client.RestClient;
25+
import org.opensearch.client.RestClientBuilder;
2626

2727
final class ElasticProvider
2828
{

elastic-mapping-updater/src/main/java/com/github/cafdataprocessing/elastic/tools/ElasticRequestHandler.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
import org.apache.http.HttpEntity;
2828
import org.apache.http.entity.ContentType;
2929
import org.apache.http.util.EntityUtils;
30-
import org.elasticsearch.client.Request;
31-
import org.elasticsearch.client.Response;
32-
import org.elasticsearch.client.ResponseException;
33-
import org.elasticsearch.client.RestClient;
34-
import org.elasticsearch.client.indices.GetIndexResponse;
35-
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
36-
import org.elasticsearch.client.indices.IndexTemplateMetadata;
37-
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
38-
import org.elasticsearch.common.xcontent.XContentFactory;
39-
import org.elasticsearch.common.xcontent.XContentParser;
40-
import org.elasticsearch.common.xcontent.XContentType;
30+
import org.opensearch.client.Request;
31+
import org.opensearch.client.Response;
32+
import org.opensearch.client.ResponseException;
33+
import org.opensearch.client.RestClient;
34+
import org.opensearch.client.indices.GetIndexResponse;
35+
import org.opensearch.client.indices.GetIndexTemplatesResponse;
36+
import org.opensearch.client.indices.IndexTemplateMetadata;
37+
import org.opensearch.common.xcontent.NamedXContentRegistry;
38+
import org.opensearch.common.xcontent.XContentFactory;
39+
import org.opensearch.common.xcontent.XContentParser;
40+
import org.opensearch.common.xcontent.XContentType;
4141
import org.slf4j.Logger;
4242
import org.slf4j.LoggerFactory;
4343

elastic-mapping-updater/src/test/java/com/github/cafdataprocessing/elastic/tools/test/ElasticMappingUpdaterIT.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@
3030

3131
import org.apache.http.HttpHost;
3232
import org.apache.http.util.EntityUtils;
33-
import org.elasticsearch.ElasticsearchException;
34-
import org.elasticsearch.action.index.IndexRequest;
35-
import org.elasticsearch.action.index.IndexResponse;
36-
import org.elasticsearch.action.search.SearchRequest;
37-
import org.elasticsearch.client.Request;
38-
import org.elasticsearch.client.RequestOptions;
39-
import org.elasticsearch.client.Response;
40-
import org.elasticsearch.client.RestClient;
41-
import org.elasticsearch.client.RestHighLevelClient;
42-
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy;
43-
import org.elasticsearch.action.support.master.AcknowledgedResponse;
44-
import org.elasticsearch.client.indices.GetIndexResponse;
45-
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
46-
import org.elasticsearch.cluster.metadata.MappingMetadata;
47-
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
48-
import org.elasticsearch.common.xcontent.XContentFactory;
49-
import org.elasticsearch.common.xcontent.XContentParser;
50-
import org.elasticsearch.common.xcontent.XContentType;
51-
import org.elasticsearch.index.query.QueryBuilder;
52-
import org.elasticsearch.index.query.QueryBuilders;
53-
import org.elasticsearch.rest.RestStatus;
54-
import org.elasticsearch.search.SearchHit;
55-
import org.elasticsearch.search.builder.SearchSourceBuilder;
33+
import org.opensearch.OpenSearchException;
34+
import org.opensearch.action.index.IndexRequest;
35+
import org.opensearch.action.index.IndexResponse;
36+
import org.opensearch.action.search.SearchRequest;
37+
import org.opensearch.client.Request;
38+
import org.opensearch.client.RequestOptions;
39+
import org.opensearch.client.Response;
40+
import org.opensearch.client.RestClient;
41+
import org.opensearch.client.RestHighLevelClient;
42+
import org.opensearch.action.support.WriteRequest.RefreshPolicy;
43+
import org.opensearch.action.support.master.AcknowledgedResponse;
44+
import org.opensearch.client.indices.GetIndexResponse;
45+
import org.opensearch.client.indices.PutIndexTemplateRequest;
46+
import org.opensearch.cluster.metadata.MappingMetadata;
47+
import org.opensearch.common.xcontent.NamedXContentRegistry;
48+
import org.opensearch.common.xcontent.XContentFactory;
49+
import org.opensearch.common.xcontent.XContentParser;
50+
import org.opensearch.common.xcontent.XContentType;
51+
import org.opensearch.index.query.QueryBuilder;
52+
import org.opensearch.index.query.QueryBuilders;
53+
import org.opensearch.rest.RestStatus;
54+
import org.opensearch.search.SearchHit;
55+
import org.opensearch.search.builder.SearchSourceBuilder;
5656
import org.junit.Test;
5757
import org.slf4j.Logger;
5858
import org.slf4j.LoggerFactory;
@@ -181,7 +181,7 @@ public void testUpdateIndexesOfUpdatedTemplate() throws IOException, GetIndexExc
181181
try {
182182
final IndexResponse response = client.index(request, RequestOptions.DEFAULT);
183183
assertTrue(response.status() == RestStatus.CREATED);
184-
} catch (final ElasticsearchException e) {
184+
} catch (final OpenSearchException e) {
185185
fail();
186186
}
187187

@@ -558,7 +558,7 @@ public void testUpdateIndexesOfUnSupportedChangesInTemplate() throws IOException
558558
try {
559559
final IndexResponse response = client.index(request, RequestOptions.DEFAULT);
560560
assertTrue(response.status() == RestStatus.CREATED);
561-
} catch (final ElasticsearchException e) {
561+
} catch (final OpenSearchException e) {
562562
fail();
563563
}
564564

@@ -693,7 +693,7 @@ public void testUpdateIndexesWithNestedFieldChanges() throws IOException, GetInd
693693
try {
694694
final IndexResponse response = client.index(request, RequestOptions.DEFAULT);
695695
assertTrue(response.status() == RestStatus.CREATED);
696-
} catch (final ElasticsearchException e) {
696+
} catch (final OpenSearchException e) {
697697
fail();
698698
}
699699

@@ -1287,7 +1287,7 @@ private void verifyIndexData(final String indexName, final QueryBuilder query, f
12871287
searchSourceBuilder.trackTotalHits(true);
12881288
searchSourceBuilder.query(query);
12891289
searchRequest.source(searchSourceBuilder);
1290-
org.elasticsearch.action.search.SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
1290+
org.opensearch.action.search.SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
12911291
final long totalDocs = searchResponse.getHits().getTotalHits().value;
12921292
LOGGER.info("Hits : {}", totalDocs);
12931293
LOGGER.info(searchResponse.toString());

pom.xml

Lines changed: 26 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -271,117 +271,87 @@
271271
<dependency>
272272
<groupId>org.apache.lucene</groupId>
273273
<artifactId>lucene-analyzers-common</artifactId>
274-
<version>8.7.0</version>
274+
<version>8.10.1</version>
275275
</dependency>
276276
<dependency>
277277
<groupId>org.apache.lucene</groupId>
278278
<artifactId>lucene-backward-codecs</artifactId>
279-
<version>8.7.0</version>
279+
<version>8.10.1</version>
280280
</dependency>
281281
<dependency>
282282
<groupId>org.apache.lucene</groupId>
283283
<artifactId>lucene-core</artifactId>
284-
<version>8.7.0</version>
284+
<version>8.10.1</version>
285285
</dependency>
286286
<dependency>
287287
<groupId>org.apache.lucene</groupId>
288288
<artifactId>lucene-grouping</artifactId>
289-
<version>8.7.0</version>
289+
<version>8.10.1</version>
290290
</dependency>
291291
<dependency>
292292
<groupId>org.apache.lucene</groupId>
293293
<artifactId>lucene-highlighter</artifactId>
294-
<version>8.7.0</version>
294+
<version>8.10.1</version>
295295
</dependency>
296296
<dependency>
297297
<groupId>org.apache.lucene</groupId>
298298
<artifactId>lucene-join</artifactId>
299-
<version>8.7.0</version>
299+
<version>8.10.1</version>
300300
</dependency>
301301
<dependency>
302302
<groupId>org.apache.lucene</groupId>
303303
<artifactId>lucene-memory</artifactId>
304-
<version>8.7.0</version>
304+
<version>8.10.1</version>
305305
</dependency>
306306
<dependency>
307307
<groupId>org.apache.lucene</groupId>
308308
<artifactId>lucene-misc</artifactId>
309-
<version>8.7.0</version>
309+
<version>8.10.1</version>
310310
</dependency>
311311
<dependency>
312312
<groupId>org.apache.lucene</groupId>
313313
<artifactId>lucene-queries</artifactId>
314-
<version>8.7.0</version>
314+
<version>8.10.1</version>
315315
</dependency>
316316
<dependency>
317317
<groupId>org.apache.lucene</groupId>
318318
<artifactId>lucene-queryparser</artifactId>
319-
<version>8.7.0</version>
319+
<version>8.10.1</version>
320320
</dependency>
321321
<dependency>
322322
<groupId>org.apache.lucene</groupId>
323323
<artifactId>lucene-sandbox</artifactId>
324-
<version>8.7.0</version>
324+
<version>8.10.1</version>
325325
</dependency>
326326
<dependency>
327327
<groupId>org.apache.lucene</groupId>
328328
<artifactId>lucene-spatial-extras</artifactId>
329-
<version>8.7.0</version>
329+
<version>8.10.1</version>
330330
</dependency>
331331
<dependency>
332332
<groupId>org.apache.lucene</groupId>
333333
<artifactId>lucene-spatial3d</artifactId>
334-
<version>8.7.0</version>
334+
<version>8.10.1</version>
335335
</dependency>
336336
<dependency>
337337
<groupId>org.apache.lucene</groupId>
338338
<artifactId>lucene-suggest</artifactId>
339-
<version>8.7.0</version>
339+
<version>8.10.1</version>
340340
</dependency>
341341
<dependency>
342342
<groupId>org.checkerframework</groupId>
343343
<artifactId>checker-qual</artifactId>
344344
<version>3.13.0</version>
345345
</dependency>
346346
<dependency>
347-
<groupId>org.elasticsearch</groupId>
348-
<artifactId>elasticsearch</artifactId>
349-
<version>7.10.2</version>
350-
</dependency>
351-
<dependency>
352-
<groupId>org.elasticsearch</groupId>
353-
<artifactId>elasticsearch-cli</artifactId>
354-
<version>7.10.2</version>
355-
</dependency>
356-
<dependency>
357-
<groupId>org.elasticsearch</groupId>
358-
<artifactId>elasticsearch-core</artifactId>
359-
<version>7.10.2</version>
360-
</dependency>
361-
<dependency>
362-
<groupId>org.elasticsearch</groupId>
363-
<artifactId>elasticsearch-geo</artifactId>
364-
<version>7.10.2</version>
365-
</dependency>
366-
<dependency>
367-
<groupId>org.elasticsearch</groupId>
368-
<artifactId>elasticsearch-secure-sm</artifactId>
369-
<version>7.10.2</version>
370-
</dependency>
371-
<dependency>
372-
<groupId>org.elasticsearch</groupId>
373-
<artifactId>elasticsearch-x-content</artifactId>
374-
<version>7.10.2</version>
375-
</dependency>
376-
<dependency>
377-
<groupId>org.elasticsearch</groupId>
378-
<artifactId>jna</artifactId>
379-
<version>5.5.0</version>
347+
<groupId>org.opensearch</groupId>
348+
<artifactId>opensearch</artifactId>
349+
<version>1.2.3</version>
380350
</dependency>
381351
<dependency>
382-
<groupId>org.elasticsearch.client</groupId>
383-
<artifactId>elasticsearch-rest-client</artifactId>
384-
<version>7.10.2</version>
352+
<groupId>org.opensearch.client</groupId>
353+
<artifactId>opensearch-rest-client</artifactId>
354+
<version>1.2.3</version>
385355
<exclusions>
386356
<exclusion>
387357
<groupId>commons-logging</groupId>
@@ -390,34 +360,14 @@
390360
</exclusions>
391361
</dependency>
392362
<dependency>
393-
<groupId>org.elasticsearch.client</groupId>
394-
<artifactId>elasticsearch-rest-high-level-client</artifactId>
395-
<version>7.10.2</version>
396-
</dependency>
397-
<dependency>
398-
<groupId>org.elasticsearch.plugin</groupId>
399-
<artifactId>aggs-matrix-stats-client</artifactId>
400-
<version>7.10.2</version>
401-
</dependency>
402-
<dependency>
403-
<groupId>org.elasticsearch.plugin</groupId>
404-
<artifactId>lang-mustache-client</artifactId>
405-
<version>7.10.2</version>
406-
</dependency>
407-
<dependency>
408-
<groupId>org.elasticsearch.plugin</groupId>
409-
<artifactId>mapper-extras-client</artifactId>
410-
<version>7.10.2</version>
411-
</dependency>
412-
<dependency>
413-
<groupId>org.elasticsearch.plugin</groupId>
414-
<artifactId>parent-join-client</artifactId>
415-
<version>7.10.2</version>
363+
<groupId>org.opensearch</groupId>
364+
<artifactId>opensearch-x-content</artifactId>
365+
<version>1.2.3</version>
416366
</dependency>
417367
<dependency>
418-
<groupId>org.elasticsearch.plugin</groupId>
419-
<artifactId>rank-eval-client</artifactId>
420-
<version>7.10.2</version>
368+
<groupId>org.opensearch.client</groupId>
369+
<artifactId>opensearch-rest-high-level-client</artifactId>
370+
<version>1.2.3</version>
421371
</dependency>
422372
<dependency>
423373
<groupId>org.hamcrest</groupId>

0 commit comments

Comments
 (0)