WithSparseVector sets the sparse vector of the document, key indices -> value vector. can use doc.SparseVector() to get the sparse vector.
(sparse map[int]float64)
| 195 | // WithSparseVector sets the sparse vector of the document, key indices -> value vector. |
| 196 | // can use doc.SparseVector() to get the sparse vector. |
| 197 | func (d *Document) WithSparseVector(sparse map[int]float64) *Document { |
| 198 | if d.MetaData == nil { |
| 199 | d.MetaData = make(map[string]any) |
| 200 | } |
| 201 | |
| 202 | d.MetaData[docMetaDataKeySparseVector] = sparse |
| 203 | |
| 204 | return d |
| 205 | } |
| 206 | |
| 207 | // SparseVector returns the sparse vector of the document, key indices -> value vector. |
| 208 | // can use doc.WithSparseVector() to set the sparse vector. |
nothing calls this directly
no outgoing calls
no test coverage detected