280
mutableContext MutableContext,
281
customSearchAttributes map[string]*commonpb.Payload,
283
>
// Filter out nil/empty payload values.
284
>
filteredSA := payload.MergeMapOfPayload(nil, customSearchAttributes)
285
>
286
>
if len(filteredSA) == 0 {
287
>
_, ok := v.SA.TryGet(mutableContext)
288
>
if !ok {
289
// Already empty, no-op
290
return
291
}
292
293
>
v.SA = NewEmptyField[*commonpb.SearchAttributes]()
visibility.go
294
>
} else {
295
>
v.SA = NewDataField(
296
>
mutableContext,
297
>
&commonpb.SearchAttributes{IndexedFields: filteredSA},
298
>
)
299
>
}
300
302
}
303