Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] try to test opensearch2 #602

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- { connector: couchbase, pre_cmd: 'docker-compose up -d couchbase_prep' }
- { connector: csv }
- { connector: dynamodb, pre_cmd: 'docker-compose up -d dynamodb' }
- { connector: elasticsearch, pre_cmd: 'docker-compose up -d elasticsearch6 elasticsearch7 opensearch1' }
- { connector: elasticsearch, pre_cmd: 'docker-compose up -d elasticsearch6 elasticsearch7 opensearch1 opensearch2' }
- { connector: file }
- { connector: ftp, pre_cmd: './scripts/ftp-servers.sh' }
- { connector: geode, pre_cmd: 'docker-compose up -d geode' }
Expand Down
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,19 @@ services:
environment:
- "discovery.type=single-node"
opensearch1:
image: opensearchproject/opensearch:1.3.1
image: opensearchproject/opensearch:1.3.14
ports:
- "9203:9200"
environment:
- "discovery.type=single-node"
- "DISABLE_SECURITY_PLUGIN=true"
opensearch2:
image: opensearchproject/opensearch:2.13.0
ports:
- "9204:9200"
environment:
- "discovery.type=single-node"
- "DISABLE_SECURITY_PLUGIN=true"
ftp:
image: stilliard/pure-ftpd:latest
ports:
Expand Down
30 changes: 15 additions & 15 deletions docs/src/main/paradox/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ Use `ElasticsearchSource.typed` and `ElasticsearchSink.create` to create source
@java[The data is converted to and from JSON by Jackson's ObjectMapper.]

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #run-typed }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #run-typed }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #run-typed }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #run-typed }

### With JSON source

Use `ElasticsearchSource.create` and `ElasticsearchSink.create` to create source and sink.

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #run-jsobject }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #run-jsobject }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #run-jsobject }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #run-jsobject }


### Writing to Elasticsearch
Expand All @@ -103,10 +103,10 @@ In the above examples, `WriteMessage` is used as the input to `ElasticsearchSink
| WriteMessage.createDeleteMessage | Delete an existing document. If there is no document with the specified `id`, do nothing. |

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #multiple-operations }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #multiple-operations }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #multiple-operations }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #multiple-operations }

### Source configuration

Expand Down Expand Up @@ -186,21 +186,21 @@ You can also build flow stages with @apidoc[ElasticsearchFlow$].
The API is similar to creating Sinks.

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #run-flow }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #run-flow }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #run-flow }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #run-flow }


### Storing documents from Strings

Elasticsearch requires the documents to be properly formatted JSON. If your data is available as JSON in Strings, you may use the pre-defined `StringMessageWriter` to avoid any conversions. For any other JSON technologies, implement a @scala[`MessageWriter[T]`]@java[`MessageWriter<T>`].

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #string }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #string }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #string }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #string }



Expand All @@ -209,10 +209,10 @@ Java
When streaming documents from Kafka, you might want to commit to Kafka **AFTER** the document has been written to Elastic.

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #kafka-example }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #kafka-example }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #kafka-example }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #kafka-example }


### Specifying custom index-name for every document
Expand All @@ -221,7 +221,7 @@ When working with index-patterns using wildcards, you might need to specify a cu
index-name for each document:

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #custom-index-name-example }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #custom-index-name-example }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchParameterizedTest.java) { #custom-index-name-example }
Expand All @@ -245,10 +245,10 @@ The easiest way of using Elasticsearch-source, is to just specify the query-para
like specifying which fields to return and so on. In such cases you can instead use 'searchParams' instead:

Scala
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV5Spec.scala) { #custom-search-params }
: @@snip [snip](/elasticsearch/src/test/scala/docs/scaladsl/ElasticsearchV6Spec.scala) { #custom-search-params }

Java
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV5Test.java) { #custom-search-params }
: @@snip [snip](/elasticsearch/src/test/java/docs/javadsl/ElasticsearchV6Test.java) { #custom-search-params }


#### Routing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class ElasticsearchV5Test extends ElasticsearchTestBase {
public class ElasticsearchV6Test extends ElasticsearchTestBase {
@BeforeClass
public static void setup() throws IOException {
setupBase();
Expand Down
Loading
Loading