Add skeleton for indexed property update

This commit is contained in:
Ante Pušić 2024-01-16 16:26:12 +01:00
parent 0335030c93
commit 60f8c3fc15
2 changed files with 12 additions and 3 deletions

View File

@ -41,16 +41,19 @@ void Indices::RemoveObsoleteEntries(uint64_t oldest_active_start_timestamp) cons
void Indices::UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx) const {
label_index_->UpdateOnAddLabel(label, vertex, tx);
label_property_index_->UpdateOnAddLabel(label, vertex, tx);
text_index_->UpdateOnAddLabel(label, vertex, tx);
}
void Indices::UpdateOnRemoveLabel(LabelId label, Vertex *vertex, const Transaction &tx) const {
label_index_->UpdateOnRemoveLabel(label, vertex, tx);
label_property_index_->UpdateOnRemoveLabel(label, vertex, tx);
text_index_->UpdateOnRemoveLabel(label, vertex, tx);
}
void Indices::UpdateOnSetProperty(PropertyId property, const PropertyValue &value, Vertex *vertex,
const Transaction &tx) const {
label_property_index_->UpdateOnSetProperty(property, value, vertex, tx);
text_index_->UpdateOnSetProperty(property, value, vertex, tx);
}
Indices::Indices(const Config &config, StorageMode storage_mode) {

View File

@ -17,12 +17,18 @@
namespace memgraph::storage {
void TextIndex::UpdateOnAddLabel(LabelId added_label, Vertex *vertex_after_update, const Transaction &tx) const {}
void TextIndex::UpdateOnAddLabel(LabelId added_label, Vertex *vertex_after_update, const Transaction &tx) const {
// Add node to this label's text index
}
void TextIndex::UpdateOnRemoveLabel(LabelId removed_label, Vertex *vertex_after_update, const Transaction &tx) const {}
void TextIndex::UpdateOnRemoveLabel(LabelId removed_label, Vertex *vertex_after_update, const Transaction &tx) const {
// Remove node from this label's text index
}
void TextIndex::UpdateOnSetProperty(PropertyId property, const PropertyValue &value, Vertex *vertex,
const Transaction &tx) const {}
const Transaction &tx) const {
// Delete this node's document and re-add the it with the new value
}
std::vector<memcxx::text_search::Context *> TextIndex::GetApplicableTextIndices(Vertex *vertex) {
std::vector<memcxx::text_search::Context *> applicable_text_indices;