Skip to content

Commit 1d04758

Browse files
committed
add: opensearch
1 parent 2788339 commit 1d04758

File tree

11 files changed

+675
-1
lines changed

11 files changed

+675
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
2-
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite
2+
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite opensearch
33
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
44
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
55
TEST_FLAGS ?=

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)
4444
* [Firebird](database/firebird)
4545
* [MS SQL Server](database/sqlserver)
4646
* [rqlite](database/rqlite)
47+
* [OpenSearch](database/opensearch)
4748

4849
### Database URLs
4950

database/opensearch/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# OpenSearch
2+
3+
* Driver work with OpenSearch through [OpenSearch REST API](https://opensearch.org/docs/latest/getting-started/communicate/#opensearch-rest-api)
4+
* Migrations are written in JSON format and support actions such as creating indices, updating mappings, modifying settings and etc.
5+
* [Examples](./examples)
6+
7+
# Usage
8+
9+
`opensearch://user:password@host:port/index`
10+
11+
| URL Query | Default value | Description |
12+
|------------|---------------------|-------------|
13+
| `index` | `.migrations` | Name of the migrations index |
14+
| `timeout` | `60s` | The max time that an operation will wait before failing. |
15+
| `user` | | The user to sign in as. Can be omitted |
16+
| `password` | | The user's password. Can be omitted |
17+
| `host` | | The host to connect to |
18+
| `port` | | The port to bind to |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETE /test-index
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
PUT /test-index
2+
{
3+
"settings": {
4+
"number_of_shards": 1,
5+
"number_of_replicas": 0
6+
},
7+
"mappings": {
8+
"properties": {
9+
"title": {
10+
"type": "text"
11+
}
12+
}
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PUT /_scripts/search_by_title
2+
{
3+
"query": {
4+
"match": {
5+
"title": "{{title}}"
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)