Comments (7)
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]
from go-client.
Okay, sorry, that worked; I did not see your link to the main example there.
from go-client.
Related to issue #20
from go-client.
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: 8183f43
Let me know if it solves your issue.
from go-client.
Closing, but I'll re-open if your issue isn't solved.
from go-client.
Please reopen the issue.
- I tried passing
with_vectors
as best as I could reverse engineer from the Go client, and it is still not working. - While the API documentation is there, there is no documentation of how to use this feature or that it even exists on the Go client.
from go-client.
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}},
from go-client.
Related Issues (12)
- connection pool HOT 2
- how to
- Get和search函数查出来Payload的值为nil HOT 5
- connection failed HOT 2
- list collection err HOT 1
- Example doesn't work? HOT 1
- Invalid link HOT 1
- User facing type is unexported HOT 2
- Go API doesn't match with REST API and better documentation is needed
- Local mode?
- Implement helper for initial upload HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-client.