Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(elasticsearch/test): make -tags integration tier compile (#17811)

Jackf08a9a9a5012
diff --git a/internal/engine/elasticsearch/kg_test.go b/internal/engine/elasticsearch/kg_test.go
index 8c17686922..6f83a4fa33 100644
--- a/internal/engine/elasticsearch/kg_test.go
+++ b/internal/engine/elasticsearch/kg_test.go
@@ -20,10 +20,11 @@ package elasticsearch
import (
"context"
- "ragflow/internal/common"
"testing"
+ "ragflow/internal/common"
"ragflow/internal/engine/types"
+ "ragflow/internal/server/config"
)
// TestKGSearchSelectFields verifies that SelectFields overrides default output
@@ -75,7 +76,7 @@ func TestKGSearchSelectFields(t *testing.T) {
// getTestConfig returns a minimal ES config for testing.
// Reads from environment or uses defaults pointing to localhost.
-func getTestConfig() map[string]interface{} {
+func getTestConfig() config.ElasticsearchConfig {
hosts := common.GetEnv(common.EnvESHost)
if hosts == "" {
hosts = "http://localhost:1200"
@@ -88,9 +89,9 @@ func getTestConfig() map[string]interface{} {
if password == "" {
password = "infini_rag_flow"
}
- return map[string]interface{}{
- "hosts": []string{hosts},
- "username": username,
- "password": password,
+ return config.ElasticsearchConfig{
+ Hosts: hosts,
+ Username: username,
+ Password: password,
}
}