// 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.searchApplication.put({
  name: "my_search_application",
  search_application: {
    indices: ["index1"],
    template: {
      script: {
        lang: "mustache",
        source:
          '\n        {\n          "query": {\n            "script_score": {\n              "query": {\n                "bool": {\n                  "filter": {\n                    "range": {\n                      "{{field}}": {\n                        "{{operator}}": {{value}}\n                      }\n                    }\n                  }\n                }\n              },\n              "script": {\n                "source": "cosineSimilarity({{#toJson}}query_vector{{/toJson}}, \'{{dense_vector_field}}\') + 1.0"\n              }\n            }\n          }\n        }\n        ',
        params: {
          field: "price",
          operator: "gte",
          value: 1000,
          dense_vector_field: "product-vector",
          query_vector: [],
        },
      },
    },
  },
});
console.log(response);
----
