mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-03 07:05:20 +00:00
26 lines
915 B
Python
26 lines
915 B
Python
![]() |
from unstructured.ingest.connector.opensearch import (
|
||
|
OpenSearchAccessConfig,
|
||
|
SimpleOpenSearchConfig,
|
||
|
)
|
||
|
from unstructured.ingest.interfaces import PartitionConfig, ProcessorConfig, ReadConfig
|
||
|
from unstructured.ingest.runner import OpenSearchRunner
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
runner = OpenSearchRunner(
|
||
|
processor_config=ProcessorConfig(
|
||
|
verbose=True,
|
||
|
output_dir="opensearch-ingest-output",
|
||
|
num_processes=2,
|
||
|
),
|
||
|
read_config=ReadConfig(),
|
||
|
partition_config=PartitionConfig(
|
||
|
metadata_exclude=["filename", "file_directory", "metadata.data_source.date_processed"],
|
||
|
),
|
||
|
connector_config=SimpleOpenSearchConfig(
|
||
|
access_config=OpenSearchAccessConfig(hosts=["http://localhost:9200"]),
|
||
|
index_name="movies",
|
||
|
fields=["ethnicity", "director", "plot"],
|
||
|
),
|
||
|
)
|
||
|
runner.run()
|