MCPcopy Create free account
hub / github.com/olivere/elastic / Source

Method Source

script.go:146–160  ·  view source on GitHub ↗

Source returns the serializable JSON for the ScriptField.

()

Source from the content-addressed store, hash-verified

144
145// Source returns the serializable JSON for the ScriptField.
146func (f *ScriptField) Source() (interface{}, error) {
147 if f.script == nil {
148 return nil, errors.New("ScriptField expects script")
149 }
150 source := make(map[string]interface{})
151 src, err := f.script.Source()
152 if err != nil {
153 return nil, err
154 }
155 source["script"] = src
156 if v := f.ignoreFailure; v != nil {
157 source["ignore_failure"] = *v
158 }
159 return source, nil
160}

Callers

nothing calls this directly

Calls 1

SourceMethod · 0.65

Tested by

no test coverage detected