This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs to include new FDW features + elasticsearch FDW
- Loading branch information
Showing
6 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...300_ingesting-data/0300_foreign-data-wrappers/0450_load-elasticsearch-index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export const meta = { | ||
id: "load-elasticsearch-index", | ||
title: "Loading Elasticsearch indexes", | ||
}; | ||
|
||
To mount a remote Elasticsearch index into the Splitgraph engine using Splitgraph's fork of [`pg_es_fdw`](https://github.com/splitgraph/postgres-elasticsearch-fdw), run: | ||
|
||
``` | ||
$ sgr mount elasticsearch -c elasticsearch:9200 -o@- <<EOF | ||
{ | ||
"table_spec": { | ||
"table_1": { | ||
"schema": { | ||
"id": "text", | ||
"@timestamp": "timestamp", | ||
"query": "text", | ||
"col_1": "text", | ||
"col_2": "boolean", | ||
}, | ||
"index": "index-pattern*", | ||
"rowid_column": "id", | ||
"query_column": "query", | ||
} | ||
} | ||
} | ||
EOF | ||
``` | ||
|
||
The FDW translates local queries into the [Elasticsearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html). You can also pass Lucene query strings as `query_column` equality clauses. For example, if `query_column` is set to `query`, you can use `WHERE query='text_body:chess'`). | ||
|
||
To snapshot the table, making it part of an actual Splitgraph image, use the [`sgr import`](../../sgr/image-management-creation/import) command. |