Skip to content

Commit

Permalink
Add IsAdditionalScalarSupported check for mv_only (#1036)
Browse files Browse the repository at this point in the history
Signed-off-by: chasingegg <[email protected]>
  • Loading branch information
chasingegg authored Jan 23, 2025
1 parent 0aa91b4 commit 668a645
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/knowhere/index/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Index {
HasRawData(const std::string& metric_type) const;

bool
IsAdditionalScalarSupported() const;
IsAdditionalScalarSupported(bool is_mv_only) const;

expected<DataSetPtr>
GetIndexMeta(const Json& json) const;
Expand Down
2 changes: 1 addition & 1 deletion include/knowhere/index/index_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class IndexNode : public Object {
HasRawData(const std::string& metric_type) const = 0;

virtual bool
IsAdditionalScalarSupported() const {
IsAdditionalScalarSupported(bool is_mv_only) const {
return false;
}

Expand Down
13 changes: 8 additions & 5 deletions src/index/hnsw/faiss_hnsw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ class BaseFaissIndexNode : public IndexNode {
}

bool
IsAdditionalScalarSupported() const override {
return true;
IsAdditionalScalarSupported(bool is_mv_only) const override {
if (is_mv_only) {
return true;
}
return false;
}

//
Expand Down Expand Up @@ -1845,11 +1848,11 @@ class HNSWIndexNodeWithFallback : public IndexNode {
}

bool
IsAdditionalScalarSupported() const override {
IsAdditionalScalarSupported(bool is_mv_only) const override {
if (use_base_index) {
return base_index->IsAdditionalScalarSupported();
return base_index->IsAdditionalScalarSupported(is_mv_only);
} else {
return fallback_search_index->IsAdditionalScalarSupported();
return fallback_search_index->IsAdditionalScalarSupported(is_mv_only);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/index/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ Index<T>::HasRawData(const std::string& metric_type) const {

template <typename T>
inline bool
Index<T>::IsAdditionalScalarSupported() const {
return this->node->IsAdditionalScalarSupported();
Index<T>::IsAdditionalScalarSupported(bool is_mv_only) const {
return this->node->IsAdditionalScalarSupported(is_mv_only);
}

template <typename T>
Expand Down

0 comments on commit 668a645

Please sign in to comment.