Closed jonathan-wondereur closed 1 year ago
Related to issue #20
I updated my code with the response I got in an email to include the undocumented WithVectors
and WithPayload
but the values are still nil for me:
// Unfiltered search
unfilteredSearchResult, err := pointsClient.Search(ctx, &pb.SearchPoints{
CollectionName: collectionName,
Vector: []float32{0.2, 0.1, 0.9, 0.7},
Limit: 3,
WithVectors: &go_client.WithVectorsSelector{
SelectorOptions: &go_client.WithVectorsSelector_Enable{},
},
WithPayload: &go_client.WithPayloadSelector{
SelectorOptions: &go_client.WithPayloadSelector_Enable{},
},
})
if err != nil {
log.Fatalf("Could not search points: %v", err)
} else {
log.Printf("Found points: %s", unfilteredSearchResult.GetResult())
}
for _, result := range unfilteredSearchResult.Result {
log.Print("id ", result.Id)
log.Print("payload ", result.Payload)
log.Print("score ", result.Score)
log.Print("version ", result.Version)
log.Print("vectors ", result.Vectors)
}
2023/05/30 14:21:36 id num:4
2023/05/30 14:21:36 payload map[]
2023/05/30 14:21:36 score 1.362
2023/05/30 14:21:36 version 2
2023/05/30 14:21:36 vectors <nil>
2023/05/30 14:21:36 id num:1
2023/05/30 14:21:36 payload map[]
2023/05/30 14:21:36 score 1.273
2023/05/30 14:21:36 version 2
2023/05/30 14:21:36 vectors <nil>
2023/05/30 14:21:36 id num:3
2023/05/30 14:21:36 payload map[]
2023/05/30 14:21:36 score 1.208
2023/05/30 14:21:36 version 2
2023/05/30 14:21:36 vectors <nil>
2023/05/30 14:21:36 Found points: [id:{num:4} score:1.362 version:2 id:{num:2} score:0.871 version:2]
It is documented here, you need to pass with_vectors
from the GetPoints proto definition to get the vectors included in the response. I added a couple of lines for this in the main example: https://github.com/qdrant/go-client/commit/8183f43dbe68321e42020a9853426a49ca5b9c12
Let me know if it solves your issue.
Closing, but I'll re-open if your issue isn't solved.
Please reopen the issue.
with_vectors
as best as I could reverse engineer from the Go client, and it is still not working.Did you have a look at my comment?
// Include all payload and vectors in the search result
WithVectors: &pb.WithVectorsSelector{SelectorOptions: &pb.WithVectorsSelector_Enable{Enable: true}},
WithPayload: &pb.WithPayloadSelector{SelectorOptions: &pb.WithPayloadSelector_Enable{Enable: true}},
Okay, sorry, that worked; I did not see your link to the main example there.
When I try even your example and try to access the payload or vectors of a result, I get an empty map and nil response.
After
unfliteredSearshResult
I tried:I expected to see the payload and vector for each of the search results but instead I got this: