Giter VIP home page Giter VIP logo

Comments (7)

jonathan-wondereur avatar jonathan-wondereur commented on May 26, 2024 1

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.

jonathan-wondereur avatar jonathan-wondereur commented on May 26, 2024 1

Okay, sorry, that worked; I did not see your link to the main example there.

from go-client.

jonathan-wondereur avatar jonathan-wondereur commented on May 26, 2024

Related to issue #20

from go-client.

Rendez avatar Rendez commented on May 26, 2024

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.

Rendez avatar Rendez commented on May 26, 2024

Closing, but I'll re-open if your issue isn't solved.

from go-client.

jonathan-wondereur avatar jonathan-wondereur commented on May 26, 2024

Please reopen the issue.

  1. I tried passing with_vectors as best as I could reverse engineer from the Go client, and it is still not working.
  2. 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.

Rendez avatar Rendez commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.