This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 29e51cdfb262bdf45fca7bea3505c0c2d5e303b7 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Jul 18 17:00:37 2019 +0200 CAMEL-13767 - Camel-elasticsearch-rest: Types are deprecated, we need to remove them and check if everything is still ok --- .../src/main/docs/elasticsearch-rest-component.adoc | 3 +-- .../elasticsearch/ElasticsearchConfiguration.java | 13 ------------- .../component/elasticsearch/ElasticsearchConstants.java | 1 - .../component/elasticsearch/ElasticsearchProducer.java | 11 ----------- .../converter/ElasticsearchActionRequestConverter.java | 12 +++--------- .../component/elasticsearch/ElasticsearchBulkTest.java | 4 ++-- .../elasticsearch/ElasticsearchClusterIndexTest.java | 6 ++---- .../ElasticsearchGetSearchDeleteExistsUpdateTest.java | 17 ++++++----------- .../component/elasticsearch/ElasticsearchIndexTest.java | 8 +++----- .../elasticsearch/ElasticsearchScrollSearchTest.java | 10 +++++----- .../dsl/ElasticsearchEndpointBuilderFactory.java | 11 ----------- 11 files changed, 22 insertions(+), 74 deletions(-) diff --git a/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc b/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc index e5e80fd..935c7e6 100644 --- a/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc +++ b/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc @@ -74,7 +74,7 @@ with the following path and query parameters: |=== -==== Query Parameters (15 parameters): +==== Query Parameters (14 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -85,7 +85,6 @@ with the following path and query parameters: | *enableSSL* (producer) | Enable SSL | false | boolean | *hostAddresses* (producer) | *Required* Comma separated list with ip:port formatted remote transport addresses to use. | | String | *indexName* (producer) | The name of the index to act against | | String -| *indexType* (producer) | The type of the index to act against | | String | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *maxRetryTimeout* (producer) | The time in ms before retry | 30000 | int | *operation* (producer) | What operation to perform | | ElasticsearchOperation diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java index ffe47c9..23525d9 100644 --- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java +++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java @@ -35,8 +35,6 @@ public class ElasticsearchConfiguration { private ElasticsearchOperation operation; @UriParam private String indexName; - @UriParam - private String indexType; @UriParam(defaultValue = "" + ElasticsearchConstants.DEFAULT_FOR_WAIT_ACTIVE_SHARDS) private int waitForActiveShards = ElasticsearchConstants.DEFAULT_FOR_WAIT_ACTIVE_SHARDS; @UriParam @Metadata(required = true) @@ -96,17 +94,6 @@ public class ElasticsearchConfiguration { } /** - * The type of the index to act against - */ - public String getIndexType() { - return indexType; - } - - public void setIndexType(String indexType) { - this.indexType = indexType; - } - - /** * Comma separated list with ip:port formatted remote transport addresses to use. */ public String getHostAddresses() { diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java index 5b69da4..4d58345 100644 --- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java +++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java @@ -21,7 +21,6 @@ public interface ElasticsearchConstants { String PARAM_OPERATION = "operation"; String PARAM_INDEX_ID = "indexId"; String PARAM_INDEX_NAME = "indexName"; - String PARAM_INDEX_TYPE = "indexType"; String PARAM_WAIT_FOR_ACTIVE_SHARDS = "waitForActiveShards"; String PARAM_SCROLL_KEEP_ALIVE_MS = "scrollKeepAliveMs"; String PARAM_SCROLL = "useScroll"; diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java index c845697..6c5743b 100644 --- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java +++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java @@ -139,13 +139,6 @@ public class ElasticsearchProducer extends DefaultProducer { configIndexName = true; } - boolean configIndexType = false; - String indexType = message.getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class); - if (indexType == null) { - message.setHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, configuration.getIndexType()); - configIndexType = true; - } - boolean configWaitForActiveShards = false; Integer waitForActiveShards = message.getHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS, Integer.class); if (waitForActiveShards == null) { @@ -225,10 +218,6 @@ public class ElasticsearchProducer extends DefaultProducer { message.removeHeader(ElasticsearchConstants.PARAM_INDEX_NAME); } - if (configIndexType) { - message.removeHeader(ElasticsearchConstants.PARAM_INDEX_TYPE); - } - if (configWaitForActiveShards) { message.removeHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS); } diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java index a119613..ee44dfa 100644 --- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java +++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java @@ -71,7 +71,6 @@ public final class ElasticsearchActionRequestConverter { return updateRequest.waitForActiveShards(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS, Integer.class)) .index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) - .type(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)) .id(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_ID, String.class)); } @@ -94,8 +93,7 @@ public final class ElasticsearchActionRequestConverter { } return indexRequest.waitForActiveShards(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS, Integer.class)) - .index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) - .type(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)); + .index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)); } @Converter @@ -114,7 +112,7 @@ public final class ElasticsearchActionRequestConverter { return (GetRequest)document; } return new GetRequest(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) - .type(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)).id((String)document); + .id((String)document); } @Converter @@ -124,7 +122,7 @@ public final class ElasticsearchActionRequestConverter { } if (document instanceof String) { return new DeleteRequest().index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) - .type(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)).id((String)document); + .id((String)document); } else { throw new IllegalArgumentException("Wrong body type. Only DeleteRequest or String is allowed as a type"); } @@ -153,13 +151,9 @@ public final class ElasticsearchActionRequestConverter { // Only setup the indexName and indexType if the message header has the // setting String indexName = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class); - String indexType = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class); if (ObjectHelper.isNotEmpty(indexName)) { searchRequest.indices(indexName); } - if (ObjectHelper.isNotEmpty(indexType)) { - searchRequest.types(indexType); - } SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); String queryText = null; diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBulkTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBulkTest.java index 36d6f3c..73734b4 100644 --- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBulkTest.java +++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBulkTest.java @@ -103,8 +103,8 @@ public class ElasticsearchBulkTest extends ElasticsearchBaseTest { return new RouteBuilder() { @Override public void configure() { - from("direct:bulk_index").to("elasticsearch-rest://elasticsearch?operation=BulkIndex&indexName=twitter&indexType=tweet"); - from("direct:bulk").to("elasticsearch-rest://elasticsearch?operation=Bulk&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:bulk_index").to("elasticsearch-rest://elasticsearch?operation=BulkIndex&indexName=twitter"); + from("direct:bulk").to("elasticsearch-rest://elasticsearch?operation=Bulk&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); } }; } diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterIndexTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterIndexTest.java index 2cc1867..c350330 100644 --- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterIndexTest.java +++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterIndexTest.java @@ -34,7 +34,6 @@ public class ElasticsearchClusterIndexTest extends ElasticsearchClusterBaseTest Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); headers.put(ElasticsearchConstants.PARAM_INDEX_ID, "1"); String indexId = template.requestBodyAndHeaders("direct:indexWithIpAndPort", map, headers, String.class); @@ -54,7 +53,6 @@ public class ElasticsearchClusterIndexTest extends ElasticsearchClusterBaseTest Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "facebook"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "post"); headers.put(ElasticsearchConstants.PARAM_INDEX_ID, "4"); String indexId = template.requestBodyAndHeaders("direct:indexWithSniffer", map, headers, String.class); @@ -75,9 +73,9 @@ public class ElasticsearchClusterIndexTest extends ElasticsearchClusterBaseTest @Override public void configure() { from("direct:indexWithIpAndPort") - .to("elasticsearch-rest://" + clusterName + "?operation=Index&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_FIRST_NODE_TRANSPORT_PORT); + .to("elasticsearch-rest://" + clusterName + "?operation=Index&indexName=twitter&hostAddresses=localhost:" + ES_FIRST_NODE_TRANSPORT_PORT); from("direct:indexWithSniffer") - .to("elasticsearch-rest://" + clusterName + "?operation=Index&indexName=twitter&indexType=tweet&enableSniffer=true&hostAddresses=localhost:" + ES_FIRST_NODE_TRANSPORT_PORT); + .to("elasticsearch-rest://" + clusterName + "?operation=Index&indexName=twitter&enableSniffer=true&hostAddresses=localhost:" + ES_FIRST_NODE_TRANSPORT_PORT); } }; } diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java index e32d72e..92e98ae 100644 --- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java +++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java @@ -168,7 +168,6 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); String indexId = template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -186,7 +185,6 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -205,7 +203,6 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -225,7 +222,6 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); String indexId = template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -253,7 +249,6 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); headers.put(ElasticsearchConstants.PARAM_INDEX_ID, "123"); String indexId = template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -327,14 +322,14 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB @Override public void configure() { from("direct:start").to("elasticsearch-rest://elasticsearch?operation=Index&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:index").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:get").to("elasticsearch-rest://elasticsearch?operation=GetById&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:multiget").to("elasticsearch-rest://elasticsearch?operation=MultiGet&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:delete").to("elasticsearch-rest://elasticsearch?operation=Delete&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:search").to("elasticsearch-rest://elasticsearch?operation=Search&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:index").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:get").to("elasticsearch-rest://elasticsearch?operation=GetById&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:multiget").to("elasticsearch-rest://elasticsearch?operation=MultiGet&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:delete").to("elasticsearch-rest://elasticsearch?operation=Delete&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:search").to("elasticsearch-rest://elasticsearch?operation=Search&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:search-1").to("elasticsearch-rest://elasticsearch?operation=Search&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:multiSearch").to("elasticsearch-rest://elasticsearch?operation=MultiSearch&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:update").to("elasticsearch-rest://elasticsearch?operation=Update&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:update").to("elasticsearch-rest://elasticsearch?operation=Update&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:exists").to("elasticsearch-rest://elasticsearch?operation=Exists&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); } }; diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java index 078aae9..2d923e8 100644 --- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java +++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchIndexTest.java @@ -56,7 +56,6 @@ public class ElasticsearchIndexTest extends ElasticsearchBaseTest { Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); String indexId = template.requestBodyAndHeaders("direct:start", map, headers, String.class); assertNotNull("indexId should be set", indexId); @@ -68,7 +67,6 @@ public class ElasticsearchIndexTest extends ElasticsearchBaseTest { Map<String, Object> headers = new HashMap<>(); headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Index); headers.put(ElasticsearchConstants.PARAM_INDEX_NAME, "twitter"); - headers.put(ElasticsearchConstants.PARAM_INDEX_TYPE, "tweet"); headers.put(ElasticsearchConstants.PARAM_INDEX_ID, "123"); String indexId = template.requestBodyAndHeaders("direct:start", map, headers, String.class); @@ -82,9 +80,9 @@ public class ElasticsearchIndexTest extends ElasticsearchBaseTest { @Override public void configure() { from("direct:start").to("elasticsearch-rest://elasticsearch?hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:index").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:deleteIndex").to("elasticsearch-rest://elasticsearch?operation=DeleteIndex&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); - from("direct:indexWithReplication").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:index").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:deleteIndex").to("elasticsearch-rest://elasticsearch?operation=DeleteIndex&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + from("direct:indexWithReplication").to("elasticsearch-rest://elasticsearch?operation=Index&indexName=twitter&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); } }; } diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchScrollSearchTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchScrollSearchTest.java index c6ae67c..e553007 100644 --- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchScrollSearchTest.java +++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchScrollSearchTest.java @@ -117,7 +117,7 @@ public class ElasticsearchScrollSearchTest extends ElasticsearchBaseTest { } private SearchRequest getScrollSearchRequest(String indexName) { - SearchRequest req = new SearchRequest().indices(indexName).types("tweet"); + SearchRequest req = new SearchRequest().indices(indexName); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.matchAllQuery()).size(1); @@ -131,15 +131,15 @@ public class ElasticsearchScrollSearchTest extends ElasticsearchBaseTest { @Override public void configure() { from("direct:scroll-index") - .to("elasticsearch-rest://elasticsearch?operation=Index&indexName=" + TWITTER_ES_INDEX_NAME + "&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + .to("elasticsearch-rest://elasticsearch?operation=Index&indexName=" + TWITTER_ES_INDEX_NAME + "&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:scroll-search") - .to("elasticsearch-rest://elasticsearch?operation=Search&indexName=" + TWITTER_ES_INDEX_NAME + "&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + .to("elasticsearch-rest://elasticsearch?operation=Search&indexName=" + TWITTER_ES_INDEX_NAME + "&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:scroll-n-split-index") - .to("elasticsearch-rest://elasticsearch?operation=Index&indexName=" + SPLIT_TWITTER_ES_INDEX_NAME + "&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); + .to("elasticsearch-rest://elasticsearch?operation=Index&indexName=" + SPLIT_TWITTER_ES_INDEX_NAME + "&hostAddresses=localhost:" + ES_BASE_HTTP_PORT); from("direct:scroll-n-split-search") .to("elasticsearch-rest://elasticsearch?" - + "useScroll=true&scrollKeepAliveMs=50000&operation=Search&indexName=" + SPLIT_TWITTER_ES_INDEX_NAME + "&indexType=tweet&hostAddresses=localhost:" + ES_BASE_HTTP_PORT) + + "useScroll=true&scrollKeepAliveMs=50000&operation=Search&indexName=" + SPLIT_TWITTER_ES_INDEX_NAME + "&hostAddresses=localhost:" + ES_BASE_HTTP_PORT) .split() .body() .streaming() diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchEndpointBuilderFactory.java index 060f39b..b2f6540 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ElasticsearchEndpointBuilderFactory.java @@ -133,17 +133,6 @@ public interface ElasticsearchEndpointBuilderFactory { return this; } /** - * The type of the index to act against. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: producer - */ - default ElasticsearchEndpointBuilder indexType(String indexType) { - setProperty("indexType", indexType); - return this; - } - /** * The time in ms before retry. * * The option is a: <code>int</code> type.