// 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({
  query: {
    term: {
      user: "kimchy",
    },
  },
  sort: {
    _script: {
      type: "number",
      script: {
        lang: "painless",
        source: "doc['field_name'].value * params.factor",
        params: {
          factor: 1.1,
        },
      },
      order: "asc",
    },
  },
});
console.log(response);
----
