Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Add/search function use questions #273

Closed
2 tasks done
NauhWuun opened this issue Sep 22, 2023 · 8 comments
Closed
2 tasks done

Bug: Add/search function use questions #273

NauhWuun opened this issue Sep 22, 2023 · 8 comments
Labels
bug Something isn't working invalid This doesn't seem right released

Comments

@NauhWuun
Copy link

Describe the bug

I used the C++ example on the official website, but I encountered a problem with the add and search function. I don’t know which function should be used here in metric_at&& metric. The following is the official website code.

I hope you can give me an example that can be used. Thank you.

Steps to reproduce

index_gt<metric_cos_gt> index;
float vec[3] = {0.1, 0.3, 0.2};

index.reserve(10);
index.add(/* key: / 42, / vector: / {&vec[0], 3}); ??? has problem.
auto results = index.search(/
query: / {&vec[0], 3}, 5 / neighbors */);

Expected behavior

I hope you can give me a case where C++ can be used

USearch version

lastest

Operating System

windows 11

Hardware architecture

x86

Which interface are you using?

C++ implementation

Contact Details

nauhwuun2009@gmail.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NauhWuun NauhWuun added bug Something isn't working invalid This doesn't seem right labels Sep 22, 2023
@ashvardanian
Copy link
Contributor

Oh, the example may be describing the interface to the high-level API located in the index_dense.hpp.

What’s your use case like? If you only plan to search through dense vectors - I’d recommend using the high-level variant.

@NauhWuun
Copy link
Author

Can you give me a complete and usable example of reserve(), add(), search(), size(), capacity(), save(), load(), view()? Although I don't know what the high-level variant usage is, I just used it. I hope you can help me. Thank you.

@NauhWuun
Copy link
Author

It would be best if you could give a more complete case. Due to the lack of documentation, the code looks very laborious, but I like to use C++ to achieve high-quality projects, so I hope it can help. Thanks again

@ashvardanian
Copy link
Contributor

Sure, @NauhWuun, I will do my best to help 🤗

I'll upload more examples in a couple of hours. In the meantime, you can find the docs of the high-level API on our website here.

@NauhWuun
Copy link
Author

Sure, @NauhWuun, I will do my best to help 🤗

I'll upload more examples in a couple of hours. In the meantime, you can find the docs of the high-level API on our website here.

I'm so looking forward to it. It feels great. Looking forward to the good news. :)

@ashvardanian
Copy link
Contributor

@NauhWuun, please check the refreshed QuickStart for C++. Does it help?

ashvardanian pushed a commit that referenced this issue Oct 13, 2023
## [2.6.1](v2.6.0...v2.6.1) (2023-10-13)

### Docs

* Refreshed C++ QuickStart ([be50172](be50172)), closes [#273](#273)

### Make

* Publish to Anaconda ([9f96e9f](9f96e9f))
@ashvardanian
Copy link
Contributor

🎉 This issue has been resolved in version 2.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@NauhWuun
Copy link
Author

🎉 This issue has been resolved in version 2.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

cool! thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right released
Projects
None yet
Development

No branches or pull requests

2 participants