def update_index(name, node)
      index = self.index(name)
      old_key = index.key(node)
      new_key = value(node, name)

      # Only replace the key if it's changed
      if old_key != new_key
        remove_from_index(name, old_key)
        add_to_index(name, new_key, node)
      end
    end
def update_index(name, node)
      index = self.index(name)
      old_key = index.key(node)
      new_key = value(node, name)

      # Only replace the key if it's changed
      if old_key != new_key
        remove_from_index(name, old_key)
        add_to_index(name, new_key, node)
      end
    end
Updates the node for the given index, including the string and symbol
 versions of the index