// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-elasticsearch-rest"]
= Elasticsearch Rest
:page-aliases: extensions/elasticsearch-rest.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-elasticsearch-rest
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable Deprecated
:cq-description: Send requests to ElasticSearch via REST API
:cq-deprecated: true
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##
endif::[]

Send requests to ElasticSearch via REST API

[id="extensions-elasticsearch-rest-whats-inside"]
== What's inside

* xref:{cq-camel-components}::elasticsearch-rest-component.adoc[Elasticsearch Rest component], URI syntax: `elasticsearch-rest:clusterName`

Please refer to the above link for usage and configuration details.

[id="extensions-elasticsearch-rest-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-elasticsearch-rest[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-elasticsearch-rest</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-elasticsearch-rest-usage"]
== Usage
This extension leverages the https://quarkus.io/guides/elasticsearch[Quarkus ElasticSearch REST Client]. 

You can choose to configure ElasticSearch via the Quarkus https://quarkus.io/guides/elasticsearch#quarkus-elasticsearch-restclient-lowlevel_configuration[configuration properties] and the `RestClient` will be autowired into the Camel ElasticSearch component. 

Or you can configure ElasticSearch via the Camel ElasticSearch component / endpoint options. When doing this, you must disable autowiring in one of the ways outlined below.

Disabling autowiring at the component level.
[source,properties]
----
camel.component.elasticsearch-rest.autowired-enabled = false
----

Disabling autowiring at the endpoint level.
[source,java]
----
from("direct:search")
    .to("elasticsearch-rest://elasticsearch?hostAddresses=localhost:9200&operation=Search&indexName=index&autowiredEnabled=false")
----

Globally disabling autowiring. Note that this disables autowiring for all components.
[source,properties]
----
camel.main.autowired-enabled = false
----

