Skip to content

Commit f315f70

Browse files
GuyAv46meiravgri
authored andcommitted
Implement rangeQuery for VecSimTieredIndex - [MOD-5164] (#360)
* implemented `rangeQuery` for VecSimTieredIndex, ... including needed utility functions * renaming `merge_results.h` and moving `filter_results` to it * fix build * first test and some fixes * improved test and added a parallel test * fix a bug where we safely get (from `safeGetEntryPoint`) the old entry point but then we get the new max level when trying to search using the old one * fix tests * Update comments * review fixes * after rebase fixes * added a general comment on tiered index's guarantees
1 parent 8f8c21d commit f315f70

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/VecSim/vec_sim_tiered_index.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ class VecSimTieredIndex : public VecSimIndexInterface {
8585
: this->frontendIndex->preferAdHocSearch(subsetSize, k, initial_check);
8686
}
8787

88+
virtual inline int64_t getAllocationSize() const override {
89+
return this->allocator->getAllocationSize() + this->backendIndex->getAllocationSize() +
90+
this->frontendIndex->getAllocationSize();
91+
}
92+
93+
virtual VecSimIndexInfo info() const override;
94+
virtual VecSimInfoIterator *infoIterator() const override;
95+
96+
VecSimQueryResult_List rangeQuery(const void *queryBlob, double radius,
97+
VecSimQueryParams *queryParams,
98+
VecSimQueryResult_Order order) override;
99+
100+
bool preferAdHocSearch(size_t subsetSize, size_t k, bool initial_check) override {
101+
// For now, decide according to the bigger index.
102+
return this->backendIndex->indexSize() > this->frontendIndex->indexSize()
103+
? this->backendIndex->preferAdHocSearch(subsetSize, k, initial_check)
104+
: this->frontendIndex->preferAdHocSearch(subsetSize, k, initial_check);
105+
}
106+
88107
// Return the current state of the global write mode (async/in-place).
89108
static VecSimWriteMode getWriteMode() { return VecSimIndexInterface::asyncWriteMode; }
90109

0 commit comments

Comments
 (0)