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

feat(search): HNSW #1799

Merged
merged 4 commits into from
Sep 8, 2023
Merged

feat(search): HNSW #1799

merged 4 commits into from
Sep 8, 2023

Conversation

dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Sep 4, 2023

No description provided.

@dranikpg dranikpg force-pushed the search-hnsw branch 2 times, most recently from 70d8c59 to 56fe552 Compare September 6, 2023 09:01
@dranikpg dranikpg changed the title WIP NONMAIN feat(search): HSWN feat(search): HSWN Sep 6, 2023
Signed-off-by: Vladislav Oleshko <[email protected]>
@dranikpg dranikpg changed the title feat(search): HSWN feat(search): HNSW Sep 6, 2023
Signed-off-by: Vladislav Oleshko <[email protected]>
@dranikpg dranikpg requested review from chakaz and kostasrim September 7, 2023 12:40
@dranikpg dranikpg marked this pull request as ready for review September 7, 2023 12:40
chakaz
chakaz previously approved these changes Sep 7, 2023
}

private:
using SpaceUnion = std::variant<hnswlib::L2Space, hnswlib::InnerProductSpace>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the name 😆

src/core/search/search_parser_test.cc Outdated Show resolved Hide resolved

bool use_hnsw = parser->ToUpper().Next().Case("HNSW", true).Case("FLAT", false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

Copy link
Contributor Author

@dranikpg dranikpg Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better than 5+ lines if {} else if {} else reply 😼 (because we need to report if its neither flat or hnsw and the argument parser does this under the hood)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get me wrong, I'm not saying it's bad. It's great, readable, no complaints.
I was just blown away that this is C++ and not, idk, Python 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properly designed C++ code can be cool as well 🤓 🧙🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get me wrong, I'm not saying it's bad. It's great, readable, no complaints.
I was just blown away that this is C++ and not, idk, Python

How do you feel about std::ranges then ? 😛

@dranikpg dranikpg merged commit e69f182 into dragonflydb:main Sep 8, 2023
@dranikpg dranikpg deleted the search-hnsw branch September 15, 2023 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants