unum-cloud / usearch

Fast Open-Source Search & Clustering engine Γ— for Vectors & πŸ”œ Strings Γ— in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram πŸ”
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.15k stars 130 forks source link

Bug: Add/search function use questions #273

Closed NauhWuun closed 1 year ago

NauhWuun commented 1 year ago

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?

Code of Conduct

ashvardanian commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

ashvardanian commented 11 months ago

:tada: This issue has been resolved in version 2.6.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

NauhWuun commented 11 months ago

πŸŽ‰ This issue has been resolved in version 2.6.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

cool! thx