2.4 KiB
sidebar_position, title, sidebar_label, slug, sidebar_custom_props
| sidebar_position | title | sidebar_label | slug | sidebar_custom_props | ||
|---|---|---|---|---|---|---|
| 3 | Switch Document Engine | Switch Document Engine | /switch_doc_engine |
|
Switch Document Engine
Switch your doc engine from Elasticsearch to Infinity or OpenSearch.
RAGFlow uses Elasticsearch by default for storing full text and vectors. To switch to Infinity, follow these steps:
-
Back up the existing deployment before switching engines. Switching engines creates a new document-index store; reindex the documents after startup.
-
Stop the Go deployment:
docker compose --env-file docker/.env -f docker/docker-compose.yml down
:::caution WARNING
Do not add -v unless you intentionally want to delete the deployment's data volumes.
:::
-
Set
DOC_ENGINE=infinityin docker/.env. -
Start the Go deployment:
docker compose --env-file docker/.env -f docker/docker-compose.yml up -d -
Reindex the documents and verify retrieval before retiring the previous document-engine data.
Switch to OpenSearch
OpenSearch is supported as an alternative to Elasticsearch. Hybrid (BM25 + vector) retrieval requires OpenSearch 2.10 or later, which provides the normalization search pipeline the Go engine provisions on startup.
-
Set
DOC_ENGINE=opensearchin docker/.env and configure the connection:OS_HOST=opensearch39 # compose service name of the OpenSearch container OS_PORT=1201 # host port; the container listens on 9201 OS_USER=admin OPENSEARCH_PASSWORD=infini_rag_flow_OS_01 -
The
ossection of conf/service_conf.yaml mirrors these settings:os: hosts: 'http://opensearch39:9201' username: 'admin' password: 'infini_rag_flow_OS_01' # insecure_skip_verify: true # HTTPS only, self-signed dev clustersFor an
https://cluster the server certificate is verified against the system trust store. Setinsecure_skip_verify: trueonly for a development cluster with a self-signed certificate. -
Start the deployment and reindex the documents, as in the Infinity steps above. The index template in conf/os_mapping.json declares
knn_vectorfields for the common embedding dimensions (128–10240); an embedding model whose dimension is not listed there cannot be indexed until a matching template is added.