Fix SetPropertiesCursor and empty properties JSON

This commit is contained in:
Ante Pušić 2024-02-05 12:02:03 +01:00
parent b0003ac08e
commit 388eb91320
2 changed files with 4 additions and 3 deletions

View File

@ -3044,6 +3044,7 @@ bool SetProperties::SetPropertiesCursor::Pull(Frame &frame, ExecutionContext &co
}
#endif
SetPropertiesOnRecord(&lhs.ValueVertex(), rhs, self_.op_, &context, cached_name_id_);
context.db_accessor->TextIndexUpdateVertex(&lhs.ValueVertex());
break;
case TypedValue::Type::Edge:
#ifdef MG_ENTERPRISE

View File

@ -26,7 +26,7 @@ void TextIndex::AddNode(Vertex *vertex_after_update, Storage *storage, const std
// NOTE: Text indexes are presently all-property indices. If we allow text indexes restricted to specific properties,
// an indexable document should be created for each applicable index.
nlohmann::json document = {};
nlohmann::json properties = {};
nlohmann::json properties = nlohmann::json::value_t::object;
for (const auto &[prop_id, prop_value] : vertex_after_update->properties.Properties()) {
switch (prop_value.type()) {
case PropertyValue::Type::Bool:
@ -238,7 +238,7 @@ bool TextIndex::CreateIndex(std::string index_name, LabelId label, memgraph::que
}
nlohmann::json document = {};
nlohmann::json properties = {};
nlohmann::json properties = nlohmann::json::value_t::object;
for (const auto &[prop_id, prop_name] : indexed_properties) {
const auto prop_value = v.GetProperty(View::NEW, prop_id).GetValue();
switch (prop_value.type()) {
@ -334,7 +334,7 @@ bool TextIndex::RecoverIndex(std::string index_name, LabelId label,
}
nlohmann::json document = {};
nlohmann::json properties = {};
nlohmann::json properties = nlohmann::json::value_t::object;
for (const auto &[prop_id, prop_name] : indexed_properties) {
if (!vertex_properties.contains(prop_id)) {
continue;