-
Notifications
You must be signed in to change notification settings - Fork 112
refactor(hgraph): centralize regular search routing #2606
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ namespace vsag { | |
| class FlattenOptimizedBuildInterface; | ||
| class HGraphOptimizedBuildSession; | ||
| class IteratorFilterContext; | ||
| class ReasoningContext; | ||
|
|
||
| /** | ||
| * @brief HGraph: hierarchical navigable graph index. | ||
|
|
@@ -805,6 +806,56 @@ class HGraph : public InnerIndexInterface { | |
| bool used_precise_float_csr{false}; | ||
| }; | ||
|
|
||
| [[nodiscard]] QueryContext | ||
| create_query_context(const SearchRequest& request, | ||
| const HGraphSearchParameters& params, | ||
| int64_t k, | ||
| bool use_custom_distance, | ||
| SearchStatistics* stats, | ||
| std::shared_ptr<ReasoningContext>& reasoning_ctx) const; | ||
|
|
||
| void | ||
| search_route_graphs(const SearchRequest& request, | ||
| const HGraphSearchParameters& params, | ||
| InnerIdType entry_point, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [suggestion] Consider removing them, or if they are kept for future use / interface consistency, comment out the parameter names. |
||
| bool use_custom_distance, | ||
| const void* query, | ||
| const VisitedListPtr& visited_list, | ||
| QueryContext* ctx, | ||
| InnerSearchParam& search_param) const; | ||
|
|
||
| static void | ||
| configure_bottom_graph_search(const SearchRequest& request, | ||
| const HGraphSearchParameters& params, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [note] The |
||
| bool is_range, | ||
|
LHT129 marked this conversation as resolved.
|
||
| int64_t k, | ||
| bool use_custom_distance, | ||
| const FilterPtr& filter, | ||
| const std::optional<float>& threshold, | ||
| QueryContext* ctx, | ||
| InnerSearchParam& search_param); | ||
|
|
||
| [[nodiscard]] DatasetPtr | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [note] Consider removing |
||
| pack_search_result(const SearchRequest& request, | ||
| int64_t k, | ||
| DistHeapPtr search_result, | ||
| const QueryContext& ctx, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [note] The This is functionally correct, but the parameter name |
||
| const MCIHybridSearchResult& mci_result, | ||
| const SearchStatistics& stats, | ||
| const std::shared_ptr<ReasoningContext>& reasoning_ctx) const; | ||
|
|
||
| [[nodiscard]] HGraphSearchParameters | ||
| parse_and_validate_search_params(const SearchRequest& request, | ||
| bool is_range, | ||
| int64_t k, | ||
| bool use_custom_distance) const; | ||
|
|
||
| [[nodiscard]] std::shared_ptr<ReasoningContext> | ||
| initialize_reasoning_context(const SearchRequest& request, | ||
| int64_t k, | ||
| bool use_custom_distance, | ||
| QueryContext* ctx) const; | ||
|
|
||
| [[nodiscard]] MCIHybridSearchResult | ||
| try_mci_search(const SearchRequest& request, | ||
| const HGraphSearchParameters& params, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.