File: 850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc

package info (click to toggle)
python-elasticsearch 9.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 22,728 kB
  • sloc: python: 104,053; makefile: 151; javascript: 75
file content (26 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This file is autogenerated, DO NOT EDIT
// mapping/runtime.asciidoc:563

[source, python]
----
resp = client.search(
    index="my-index-000001",
    runtime_mappings={
        "measures.voltage": {
            "type": "double",
            "script": {
                "source": "if (doc['model_number.keyword'].value.equals('HG537PU'))\n        {emit(1.7 * params._source['measures']['voltage']);}\n        else{emit(params._source['measures']['voltage']);}"
            }
        }
    },
    query={
        "match": {
            "model_number": "HG537PU"
        }
    },
    fields=[
        "measures.voltage"
    ],
)
print(resp)
----