Fix text index logic on label removal

This commit is contained in:
Ante Pušić 2024-02-08 00:14:06 +01:00
parent e9aaf82985
commit 743f7b343a
3 changed files with 9 additions and 1 deletions

View File

@ -576,6 +576,10 @@ class DbAccessor final {
void TextIndexUpdateVertex(VertexAccessor *vertex) { accessor_->TextIndexUpdateVertex(&vertex->impl_); }
void TextIndexUpdateVertex(VertexAccessor *vertex, std::vector<storage::LabelId> removed_labels) {
accessor_->TextIndexUpdateVertex(&vertex->impl_, removed_labels);
}
std::vector<storage::Gid> TextIndexSearch(std::string index_name, std::string search_query) const {
return accessor_->TextIndexSearch(index_name, search_query);
}

View File

@ -3304,7 +3304,7 @@ bool RemoveLabels::RemoveLabelsCursor::Pull(Frame &frame, ExecutionContext &cont
}
if (flags::run_time::GetTextSearchEnabled()) {
context.db_accessor->TextIndexUpdateVertex(&vertex);
context.db_accessor->TextIndexUpdateVertex(&vertex, self_.labels_);
}
return true;

View File

@ -239,6 +239,10 @@ class Storage {
storage_->indices_.text_index_->UpdateNode(vertex->vertex_, storage_, storage_->timestamp_);
}
void TextIndexUpdateVertex(VertexAccessor *vertex, std::vector<LabelId> removed_labels) {
storage_->indices_.text_index_->UpdateNode(vertex->vertex_, storage_, storage_->timestamp_, removed_labels);
}
std::vector<Gid> TextIndexSearch(std::string index_name, std::string search_query) const {
return storage_->indices_.text_index_->Search(index_name, search_query);
}