167
indexName string,
168
newCustomSearchAttributes map[string]enumspb.IndexedValueType,
170
>
171
>
clusterMetadataResponse, err := m.clusterMetadataManager.GetCurrentClusterMetadata(ctx)
172
>
if err != nil {
173
return err
174
}
175
176
>
clusterMetadata := clusterMetadataResponse.ClusterMetadata
manager.go
177
>
if clusterMetadata.IndexSearchAttributes == nil {
178
clusterMetadata.IndexSearchAttributes = map[string]*persistencespb.IndexSearchAttributes{indexName: nil}
179
}
180
>
clusterMetadata.IndexSearchAttributes[indexName] = &persistencespb.IndexSearchAttributes{CustomSearchAttributes: newCustomSearchAttributes}
manager.go
181
>
_, err = m.clusterMetadataManager.SaveClusterMetadata(ctx, &persistence.SaveClusterMetadataRequest{
182
>
ClusterMetadata: clusterMetadata,
183
>
Version: clusterMetadataResponse.Version,
184
>
})
185
>
// Flush local cache, even if there was an error, which is most likely version mismatch (=stale cache).
186
>
m.cache.Store(cache{})
187
>
188
>
return err
189
}