| 42 | } |
| 43 | |
| 44 | func (gc *GrpcClient) QueryMultipleVectorsUsingSimilarTo(vector []float32, pred string, topK int) ([][]float32, error) { |
| 45 | vectorQuery := fmt.Sprintf(` |
| 46 | { |
| 47 | vector(func: similar_to(%v, %v, "%v")) { |
| 48 | uid |
| 49 | %v |
| 50 | } |
| 51 | }`, pred, topK, vector, pred) |
| 52 | resp, err := gc.Query(vectorQuery) |
| 53 | |
| 54 | if err != nil { |
| 55 | return [][]float32{}, err |
| 56 | } |
| 57 | |
| 58 | return UnmarshalVectorResp(resp) |
| 59 | } |
| 60 | |
| 61 | func (gc *GrpcClient) QuerySingleVectorsUsingUid(uid, pred string) ([][]float32, error) { |
| 62 | vectorQuery := fmt.Sprintf(` |