David Potter bc791d53f4
feat: add opensearch source and destination connector (#2349)
Adds OpenSearch as a source and destination.

Since OpenSearch is a fork of Elasticsearch, these connectors rely
heavily on inheriting the Elasticsearch connectors whenever possible.

- Adds OpenSearch source connector to be able to ingest documents from
OpenSearch.
- Adds OpenSearch destination connector to be able to ingest documents
from any supported source, embed them and write the embeddings /
documents into OpenSearch.
- Defines an example unstructured elements schema for users to be able
to setup their unstructured OpenSearch indexes easily.

---------

Co-authored-by: potter-potter <david.potter@gmail.com>
2024-01-17 04:31:49 +00:00

31 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Runs a docker container to create an opensearch cluster,
# fills the ES cluster with data,
# processes all the files in the 'movies' index in the cluster using the `unstructured` library.
# Structured outputs are stored in opensearch-ingest-output
# shellcheck source=/dev/null
sh scripts/opensearch-test-helpers/source_connector/create-fill-and-check-opensearch.sh
wait
# Kill the container so the script can be repeatedly run using the same ports
trap 'echo "Stopping opensearch Docker container"; docker stop os-test' EXIT
PYTHONPATH=. ./unstructured/ingest/main.py \
opensearch \
--hosts "<List of URLs where opensearch index is served>" \
--index-name "<Index name to ingest data from>" \
--username "<Username to authenticate into the index>" \
--password "<Password to authenticate into the index>" \
--fields "<If provided, will limit the fields returned by opensearch to this comma-delimited list" \
--batch-size "<How many records to read at a time per process>" \
--num-processes "<Number of processes to be used to upload, ie. 2>" \
--ca-certs "<path/to/ca/certs>" \
--client-cert "<path/to/client/cert>" \
--client-key "<path/to/client/key>" \
--use-ssl \
--verify-certs \
--ssl-show-warn