Ability to clear/unset search attributes

As of right now, Search Attributes can only be set and updated but not cleared. In order to simulate a clear we can set the value to some sentinel value, e.g Int being set to -1.

Documents would stay cleaner and queries more simplified if these search attributes could just be “unset”.

1 Like

Thanks @pauldemarco. This is a great feature ask.

Correctly Temporal does not have any support for deleting a key from the index document. The API provided by SDK only supports Upsert semantics where a new map of key/value pair is merged with the existing document. So the only way you can achieve removing keys is to use the approach you described above by setting the key to some Unspecified value and then filter using it.

I have filed a feature request to address this in the future.

1 Like