Open juanandreas opened 4 months ago
FieldData() used to get result proto data,so you will get the source data like []byte
Usually we could get colum data like hits.Fields.GetColumn("pk").GetAsInt64(id) but now we seems lack GetAsSparseVector.
Maybe you can get sparse data by
vector, err := hits.Fields.GetColumn("vector").Get(id)
if err != nil {
return err
}
sparse,ok:= vector.(entity.SparseEmbedding)
or
vectorColumn := hits.Fields.GetColumn("vector").(*entity.ColumnSparseFloatVector)
sparse, err := vectorColumn.ValueByIdx(idx)
if err != nil {
return err
}
But now SparseEmbedding only support get position and value by index, not return a map.
Seems we should complete GetSparseVector for Column and add Mapping method for SparseEmbedding.
Is there an existing issue for this?
Current Behavior
When I run this code to get the content of a sparse float vector:
I get:
Expected Behavior
This should return me a hashmap of an integer to float32 value mapping.
Steps To Reproduce
No response
Environment
No response
Anything else?
No response