...
// 1. load vector field binlog file from minio
// 2. decode binlog file, get vector raw data
// 3. save raw data into local disk
// 4. do mmap
func (s *Segment) segmentVectorFieldDataMmap(fieldID int64, binlog string, rowCount int, data interface{}) ([]byte, error)
```
3. 在 `segmentLoader` 中添加新接口
```go
func (loader *segmentLoader) loadSegmentVectorFieldsData(segment *Segment, binlogs []string) error
```
- Add new interface in segmentLoader
Code Block |
---|
// load vector field's data from info.fieldBinlog, save the raw data into info.rawData
func (loader *segmentLoader) loadSegmentVectorFieldsData(info *VectorFieldInfo) error { |
4. 在 retrieve 函数中添加如下逻辑
* 当输出列包含向量列、向量列未加载、且当前 segment 返回值不为空时
```go
if err = q.historical.loader.loadSegmentVectorFieldsData(segment, binlogs); err != nil {
return err
}
if err = segment.fillRetrieveResults(plan, result); err != nil {
return err
}
```5. load_segment 接口添加参数 `include_vector_field` or `vector_fields[]`
**`search` 接口不支持返回原始向量数据**
如果想得到 `search` 返回结果所对应的原始向量数据,可通过再次调用 `get_entity_by_id` 得到。
...