// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await 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"],
});
console.log(response);
----
