mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
## Summary
Both ES and Infinity engines now respect `SearchRequest.SelectFields`,
allowing callers to specify output columns for KG
entity/relation/community queries instead of the default chunk columns.
### Changes
- **`internal/engine/elasticsearch/chunk.go`**: Added `SelectFields`
override after default `outputColumns`
- **`internal/engine/infinity/chunk.go`**: Added `SelectFields` override
after default `outputColumns`
- **`internal/engine/elasticsearch/kg_test.go`** (new): Integration test
(skipped unless `ES_TEST=1`)
### Usage
```go
result, err := docEngine.Search(ctx, \&types.SearchRequest{
KbIDs: kbIDs,
SelectFields: []string{entity_kwd, entity_type_kwd, rank_flt, n_hop_with_weight},
Filter: map[string]interface{}{knowledge_graph_kwd: entity},
})
```
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>