1012
namespaceName namespace.Name,
1013
chasmMapper *chasm.VisibilitySearchAttributesMapper,
1015
>
logParseError := func(fieldName string, fieldValue any, err error, docID string) error {
1016
metrics.ElasticsearchDocumentParseFailuresCount.With(s.metricsHandler).Record(1)
1017
return serviceerror.NewInternalf("unable to parse Elasticsearch document(%s) %q field value %q: %v", docID, fieldName, fieldValue, err)
1018
}
1019
1021
>
d := json.NewDecoder(bytes.NewReader(docSource))
1022
>
// Very important line. See finishParseJSONValue bellow.
1023
>
d.UseNumber()
1024
>
if err := d.Decode(&sourceMap); err != nil {
1025
metrics.ElasticsearchDocumentParseFailuresCount.With(s.metricsHandler).Record(1)
1026
return nil, serviceerror.NewInternalf("unable to unmarshal JSON from Elasticsearch document(%s): %v", docID, err)
1027
}
1028
1030
>
1031
>
var (
1032
>
isValidType bool
1033
>
memo []byte
1034
>
memoEncoding string
1035
>
allSearchAttributes map[string]any
1036
>
)
1037
>
record := &store.InternalExecutionInfo{}
1038
>
for fieldName, fieldValue := range sourceMap {
1039
>
switch fieldName {
1040
case sadefs.NamespaceID,
1041
sadefs.VisibilityTaskKey: