跳到主要内容

Elastic

捆绑包 (Bundles) 包含支持特定第三方与 Langflow 集成的自定义组件。

本页面介绍了 Elastic 捆绑包中可用的组件。

Elasticsearch

Elasticsearch 组件使用 ElasticsearchStore 对 Elasticsearch 实例进行读写操作。

关于向量存储实例

Because Langflow is based on LangChain, vector store components use an instance of LangChain vector store to drive the underlying read and write functions. These instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema.

In component code, this is often instantiated as vector_store, but some vector store components use a different name, such as the provider name.

Some LangChain classes don't expose all possible options as component parameters. Depending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow. For information about specific options, see the LangChain API reference and vector store provider's documentation.

If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of Data objects or a tabular DataFrame. If both types are supported, you can set the format near the vector store component's output port in the visual editor.

Elasticsearch 参数

您可以检查向量存储组件的参数,以详细了解它接受的输入、支持的功能以及如何配置它。

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters. Conditional parameters may not be visible on the Controls pane until you set the required dependencies.

有关可接受的值和功能的更多信息,请参阅 Elasticsearch 文档 或检查 组件代码

名称类型描述
elasticsearch_urlString输入参数。Elasticsearch 服务器 URL。
cloud_idString输入参数。Elasticsearch Cloud ID。
index_nameString输入参数。Elasticsearch 索引名称。
ingest_dataData输入参数。要加载到向量存储中的记录。
search_queryString输入参数。用于相似度搜索的查询字符串。
cache_vector_storeBoolean输入参数。如果为 true,组件将在内存中缓存向量存储以加快读取速度。默认值:启用 (true)。
usernameString输入参数。用于 Elasticsearch 身份验证的用户名。所有本地部署均必填。如果 api_key 为空,则云部署也必填。
passwordSecretString输入参数。用于 Elasticsearch 身份验证的密码。所有本地部署均必填。如果 api_key 为空,则云部署也必填。
embeddingEmbeddings输入参数。要使用的嵌入模型。
search_typeString输入参数。要执行的搜索类型。选项包括 similarity(相似度,默认)或 mmr
number_of_resultsInteger输入参数。要返回的搜索结果数量。默认值:4。
search_score_thresholdFloat输入参数。搜索结果的最小相似度分数阈值。默认值:0。
api_keySecretString输入参数。用于 Elastic Cloud 身份验证的 API 密钥。如果提供,则不需要 usernamepassword
verify_certsBoolean输入参数。连接到 Elasticsearch 时是否验证 SSL 证书。默认值:启用 (true)。

OpenSearch

OpenSearch 组件使用 OpenSearchVectorSearch 对 OpenSearch 实例进行读写操作。

关于向量存储实例

Because Langflow is based on LangChain, vector store components use an instance of LangChain vector store to drive the underlying read and write functions. These instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema.

In component code, this is often instantiated as vector_store, but some vector store components use a different name, such as the provider name.

Some LangChain classes don't expose all possible options as component parameters. Depending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow. For information about specific options, see the LangChain API reference and vector store provider's documentation.

OpenSearch 参数

您可以检查向量存储组件的参数,以详细了解它接受的输入、支持的功能以及如何配置它。

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters. Conditional parameters may not be visible on the Controls pane until you set the required dependencies.

有关可接受的值和功能的更多信息,请参阅 OpenSearch 文档 或检查 组件代码

名称类型描述
opensearch_urlString输入参数。OpenSearch 集群的 URL,例如 https://192.168.1.1:9200
index_nameString输入参数。向量在 OpenSearch 集群中存储的索引名称。默认值:langflow
ingest_dataData输入参数。要摄取到向量存储中的数据。
search_inputString输入参数。输入搜索查询。如果检索所有文档或使用混合搜索,请留空。
cache_vector_storeBoolean输入参数。如果为 true,组件将在内存中缓存向量存储以加快读取速度。默认值:启用 (true)。
embeddingEmbeddings输入参数。连接一个 嵌入模型组件,用于从搜索查询生成嵌入。
search_typeString输入参数。要执行的搜索类型。选项包括 similarity(相似度,默认)、similarity_score_threshold(相似度分数阈值)、mmr
number_of_resultsInteger输入参数。搜索中要返回的结果数量。默认值:4。
search_score_thresholdFloat输入参数。搜索结果的最小相似度分数阈值。默认值:0。
usernameString输入参数。OpenSearch 集群的用户名。默认值:admin
passwordSecretString输入参数。OpenSearch 集群的密码。
use_sslBoolean输入参数。是否使用 SSL。默认值:启用 (true)。
verify_certsBoolean输入参数。是否验证 SSL 证书。默认值:禁用 (false)。
hybrid_search_queryString输入参数。以 JSON 格式提供自定义混合搜索查询。这允许您结合向量相似度和关键词匹配。

OpenSearch 输出

If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of Data objects or a tabular DataFrame. If both types are supported, you can set the format near the vector store component's output port in the visual editor.

向量存储连接端口 (Vector Store Connection port)

OpenSearch 组件有一个额外的已弃用的 Vector Store Connection 输出。 此输出只能连接到 VectorStore 输入端口,旨在与专用 Graph RAG 组件配合使用。

OpenSearch 组件不需要单独的 Graph RAG 组件,因为 OpenSearch 实例通过内置的 RAG 功能和插件支持图遍历 (Graph traversal)。

Search