Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"user": { "index": 11, "kind": "property", "displayName": "User", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Username" }
},
"headers": {
"ID": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" },
"SEARCH_QUERY": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" },
"INDEX_SETTINGS": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" },
"INDEX_NAME": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" },
"OPERATION": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" }
"CamelElasticsearchId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" },
"CamelElasticsearchSearchQuery": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" },
"CamelElasticsearchIndexSettings": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" },
"CamelElasticsearchIndexName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" },
"CamelElasticsearchOperation": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" }
},
"properties": {
"clusterName": { "index": 0, "kind": "path", "displayName": "Cluster Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cluster Name" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"user": { "index": 11, "kind": "property", "displayName": "User", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Username" }
},
"headers": {
"ID": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" },
"SEARCH_QUERY": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" },
"INDEX_SETTINGS": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" },
"INDEX_NAME": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" },
"OPERATION": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" }
"CamelElasticsearchId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "ID of the object to index or retrieve or delete", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#ID" },
"CamelElasticsearchSearchQuery": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JSON Query to perform for search", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#SEARCH_QUERY" },
"CamelElasticsearchIndexSettings": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Advanced - The JSON Index Settings and\/or Mappings Query to perform to create an index", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_SETTINGS" },
"CamelElasticsearchIndexName": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Index name", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#INDEX_NAME" },
"CamelElasticsearchOperation": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation", "enum": [ "INDEX_OR_UPDATE", "GET_BY_ID", "DELETE", "CREATE_INDEX", "DELETE_INDEX", "SEARCH" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.elasticsearch.rest.client.ElasticSearchRestClientConstant#OPERATION" }
},
"properties": {
"clusterName": { "index": 0, "kind": "path", "displayName": "Cluster Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cluster Name" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ You can set the name of the target index from the `indexName` URI parameter opti
You must provide the index id of the content to delete either in the message body, or via a message header with the key `ID` .

|`CREATE_INDEX` | |Creates the specified `indexName` and returns a `boolean` value as the message exchange body, indicating whether the operation was successful.
You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `INDEX_NAME`.
You may also provide a header with the key `INDEX_SETTINGS` where the value is a JSON String representation of the index settings.
You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `CamelElasticsearchIndexName`.
You may also provide a header with the key `CamelElasticsearchIndexSettings` where the value is a JSON String representation of the index settings.

|`DELETE_INDEX` | |Deletes the specified `indexName` and returns a `boolean` value as the message exchange body, indicating whether the operation was successful.
You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `INDEX_NAME`.
You can set the name of the target index to create from the `indexName` URI parameter option, or by providing a message header with the key `CamelElasticsearchIndexName`.

|`SEARCH` |`Map` (optional) |Search for content with either a `Map` of `String` keys & values of query criteria. Or a JSON string representation of the query. Matching documents are returned as a JSON string set on the message exchange body.
You can set the JSON query String by providing a message header with the key `SEARCH_QUERY`.
You can set the JSON query String by providing a message header with the key `CamelElasticsearchSearchQuery`.
You can set the message exchange body to a `Map` of `String` keys & values for the query criteria.

|===
Expand All @@ -93,7 +93,7 @@ To update existing indexed content, provide the `ID` message header and the mess
[source,java]
----
from("direct:index")
.setHeader("ID").constant("1")
.setHeader("CamelElasticsearchId").constant("1")
.setBody().constant("{\"content\": \"ElasticSearch REST Client With Camel\"}")
.to("elasticsearch-rest-client://myCluster?operation=INDEX_OR_UPDATE&indexName=myIndex");
----
Expand All @@ -103,7 +103,7 @@ from("direct:index")
[source,java]
----
from("direct:getById")
.setHeader("ID").constant("1")
.setHeader("CamelElasticsearchId").constant("1")
.to("elasticsearch-rest-client://myCluster?operation=GET_BY_ID&indexName=myIndex");
----

Expand All @@ -114,7 +114,7 @@ To delete indexed content, provide the `ID` message header.
[source,java]
----
from("direct:getById")
.setHeader("ID").constant("1")
.setHeader("CamelElasticsearchId").constant("1")
.to("elasticsearch-rest-client://myCluster?operation=DELETE&indexName=myIndex");
----

Expand All @@ -138,7 +138,7 @@ String indexSettings = "{\"settings\":{\"number_of_replicas\": 1,\"number_of_sha
[source,java]
----
from("direct:createIndex")
.setHeader("INDEX_SETTINGS").constant(indexSettings)
.setHeader("CamelElasticsearchIndexSettings").constant(indexSettings)
.to("elasticsearch-rest-client://myCluster?operation=CREATE_INDEX&indexName=myIndex");
----

Expand All @@ -159,7 +159,7 @@ Search with a JSON query.
[source,java]
----
from("direct:search")
.setHeader("SEARCH_QUERY").constant("{\"query\":{\"match\":{\"content\":\"ElasticSearch With Camel\"}}}")
.setHeader("CamelElasticsearchSearchQuery").constant("{\"query\":{\"match\":{\"content\":\"ElasticSearch With Camel\"}}}")
.to("elasticsearch-rest-client://myCluster?operation=SEARCH&indexName=myIndex");
----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
public class ElasticSearchRestClientConstant {

@Metadata(description = " ID of the object to index or retrieve or delete", javaType = "String")
public static final String ID = "ID";
public static final String ID = "CamelElasticsearchId";

@Metadata(description = "The JSON Query to perform for search", javaType = "String")
public static final String SEARCH_QUERY = "SEARCH_QUERY";
public static final String SEARCH_QUERY = "CamelElasticsearchSearchQuery";

@Metadata(description = "Advanced - The JSON Index Settings and/or Mappings Query to perform to create an index",
javaType = "String")
public static final String INDEX_SETTINGS = "INDEX_SETTINGS";
public static final String INDEX_SETTINGS = "CamelElasticsearchIndexSettings";

@Metadata(description = "The Index name", javaType = "String")
public static final String INDEX_NAME = "INDEX_NAME";
public static final String INDEX_NAME = "CamelElasticsearchIndexName";

@Metadata(description = "The operation to perform",
javaType = "org.apache.camel.component.elasticsearch.rest.client.ElasticsearchRestClientOperation")
public static final String OPERATION = "OPERATION";
public static final String OPERATION = "CamelElasticsearchOperation";

public static final int SOCKET_CONNECTION_TIMEOUT = 30000;
public static final int SNIFFER_INTERVAL_AND_FAILURE_DELAY = 60000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ public static class ElasticsearchRestClientHeaderNameBuilder {
*
* Group: producer
*
* @return the name of the header {@code ID}.
* @return the name of the header {@code ElasticsearchId}.
*/
public String iD() {
return "ID";
public String elasticsearchId() {
return "CamelElasticsearchId";
}
/**
* The JSON Query to perform for search.
Expand All @@ -478,10 +478,10 @@ public String iD() {
*
* Group: producer
*
* @return the name of the header {@code SEARCH_QUERY}.
* @return the name of the header {@code ElasticsearchSearchQuery}.
*/
public String searchQuery() {
return "SEARCH_QUERY";
public String elasticsearchSearchQuery() {
return "CamelElasticsearchSearchQuery";
}
/**
* Advanced - The JSON Index Settings and/or Mappings Query to perform
Expand All @@ -491,10 +491,10 @@ public String searchQuery() {
*
* Group: producer
*
* @return the name of the header {@code INDEX_SETTINGS}.
* @return the name of the header {@code ElasticsearchIndexSettings}.
*/
public String indexSettings() {
return "INDEX_SETTINGS";
public String elasticsearchIndexSettings() {
return "CamelElasticsearchIndexSettings";
}
/**
* The Index name.
Expand All @@ -503,10 +503,10 @@ public String indexSettings() {
*
* Group: producer
*
* @return the name of the header {@code INDEX_NAME}.
* @return the name of the header {@code ElasticsearchIndexName}.
*/
public String indexName() {
return "INDEX_NAME";
public String elasticsearchIndexName() {
return "CamelElasticsearchIndexName";
}
/**
* The operation to perform.
Expand All @@ -516,10 +516,10 @@ public String indexName() {
*
* Group: producer
*
* @return the name of the header {@code OPERATION}.
* @return the name of the header {@code ElasticsearchOperation}.
*/
public String oPERATION() {
return "OPERATION";
public String elasticsearchOperation() {
return "CamelElasticsearchOperation";
}
}
static ElasticsearchRestClientEndpointBuilder endpointBuilder(String componentName, String path) {
Expand Down
Loading