wuchong commented on a change in pull request #12579:
URL: https://github.com/apache/flink/pull/12579#discussion_r438576207



##########
File path: docs/dev/table/connectors/elasticsearch.md
##########
@@ -0,0 +1,266 @@
+---
+title: "Elasticsearch SQL Connector"
+nav-title: Elasticsearch
+nav-parent_id: sql-connectors
+nav-pos: 3
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<span class="label label-primary">Sink: Batch</span>
+<span class="label label-primary">Sink: Streaming Append & Upsert Mode</span>
+
+* This will be replaced by the TOC
+{:toc}
+
+The Elasticsearch connector allows for writing into an index of the 
Elasticsearch search engine. This document describes how to setup the 
Elasticsearch Connector to run SQL queries against Elasticsearch.
+
+The connector can operate in upsert mode for exchanging UPDATE/DELETE messages 
with the external system using the primary key defined on the DDL.
+
+If no primary key is defined on the DDL, the connector can only operate in 
append mode for exchanging INSERT only messages with external system.
+
+Dependencies
+------------
+
+In order to setup the Elasticsearch connector, the following table provide 
dependency information for both projects using a build automation tool (such as 
Maven or SBT) and SQL Client with SQL JAR bundles.
+
+| Elasticsearch Version   | Maven dependency                                   
                | SQL Client JAR         |
+| :---------------------- | 
:----------------------------------------------------------------- | 
:----------------------|
+| 6.x                     | 
`flink-connector-elasticsearch6{{site.scala_version_suffix}}`      | {% if 
site.is_stable %} 
[Download](https://repo.maven.apache.org/maven2/org/apache/flink/flink-connector-elasticsearch6{{site.scala_version_suffix}}/{{site.version}}/flink-connector-elasticsearch6{{site.scala_version_suffix}}-{{site.version}}.jar)
 {% else %} Only available for stable releases {% endif %}|
+| 7.x and later versions  | 
`flink-connector-elasticsearch7{{site.scala_version_suffix}}`      | {% if 
site.is_stable %} 
[Download](https://repo.maven.apache.org/maven2/org/apache/flink/flink-connector-elasticsearch7{{site.scala_version_suffix}}/{{site.version}}/flink-connector-elasticsearch7{{site.scala_version_suffix}}-{{site.version}}.jar)
 {% else %} Only available for stable releases {% endif %}|
+
+<br>
+<span class="label label-danger">Attention</span> Elasticsearch connector 
works with JSON format which defines how to encode documents for the external 
system, therefore, it must be added as a [dependency]({% link 
dev/table/connectors/formats/index.md %}).
+
+How to create an Elasticsearch table
+----------------
+
+The example below shows how to create an Elasticsearch sink table:
+
+<div class="codetabs" markdown="1">
+<div data-lang="SQL" markdown="1">
+{% highlight sql %}
+CREATE TABLE myUserTable (
+  user_id STRING,
+  user_name STRING
+  uv BIGINT,
+  pv BIGINT,
+  PRIMARY KEY (user_id) NOT ENFORCED
+) WITH (
+  'connector' = 'elasticsearch-7',
+  'hosts' = 'http://localhost:9200',
+  'index' = 'users'
+);
+{% endhighlight %}
+</div>
+</div>
+
+Connector Options
+----------------
+
+<table class="table table-bordered">
+    <thead>
+      <tr>
+        <th class="text-left" style="width: 25%">Option</th>
+        <th class="text-center" style="width: 8%">Required</th>
+        <th class="text-center" style="width: 7%">Default</th>
+        <th class="text-center" style="width: 10%">Type</th>
+        <th class="text-center" style="width: 50%">Description</th>
+      </tr>
+    </thead>
+    <tbody>
+    <tr>
+      <td><h5>connector</h5></td>
+      <td>required</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>Specify what connector to use, valid values are:
+      <ul>
+      <li><code>elasticsearch-6</code>: connect to Elasticsearch 6.x 
cluster</li>
+      <li><code>elasticsearch-7</code>: connect to Elasticsearch 7.x and later 
versions cluster</li>
+      </ul></td>
+    </tr>
+    <tr>
+      <td><h5>hosts</h5></td>
+      <td>required</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>One or more Elasticsearch hosts to connect to, e.g. 
<code>'http://host_name:9092;http://host_name:9093'</code>.</td>
+    </tr>
+    <tr>
+      <td><h5>index</h5></td>
+      <td>required</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>Elasticsearch index for every record. Can be a static index (e.g. 
<code>'myIndex'</code>) or
+       a dynamic index (e.g. <code>'index-{log_ts|yyyy-MM-dd}'</code>).
+       See the following <a href="#dynamic-index">Dynamic Index</a> section 
for more details.</td>
+    </tr>
+    <tr>
+      <td><h5>document-type</h5></td>
+      <td>required in 6.x</td>
+      <td style="word-wrap: break-word;">(none)</td>
+      <td>String</td>
+      <td>Elasticsearch document type. Not necessary anymore in 
<code>elasticsearch-7</code>.</td>
+    </tr>
+    <tr>
+      <td><h5>document-id.key-delimiter</h5></td>
+      <td>optional</td>
+      <td style="word-wrap: break-word;">_</td>

Review comment:
       Yes. I added the comment in the description column. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to