...
在 search / query 结束后,再分析 output_fields 里是否包含向量列,若包含,则加载结果 IDs 所在 segment 向量列,通过结果 IDs 对应的 offset 得到对应向量数据。1.
- Add new field VectorFieldInfo into segment struct to record vector field related
...
- information
Code Block |
---|
type VectorFieldInfo struct {
mu sync.RWMutex
fieldID UniqueID
fieldBinlog *datapb.FieldBinlog
rowDataInMemory bool
rawData map[string]storage.FieldData // map[binlogPath]FieldData
}
type Segment struct {
... ...
vectorFieldInfos map[UniqueID]*VectorFieldInfo
} |
...
- Add new interface in segment
Code Block |
---|
// based on result.Offset, get vector raw data from fieldInfo,
// then fill vector raw data into result
func (s *Segment) fillRetrieveResults(result *segcorepb.RetrieveResults, fieldInfo *VectorFieldInfo) error |
```go
// fill vector raw data into RetrieveResults
func (s *Segment) fillRetrieveResults(plan *RetrievePlan, result *segcorepb.RetrieveResults) error
...