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

[source, js]
----
const response = await client.search({
  index: "movies",
  size: 10,
  retriever: {
    rescorer: {
      rescore: {
        window_size: 50,
        query: {
          rescore_query: {
            script_score: {
              query: {
                match_all: {},
              },
              script: {
                source:
                  "cosineSimilarity(params.queryVector, 'product-vector_final_stage') + 1.0",
                params: {
                  queryVector: [-0.5, 90, -10, 14.8, -156],
                },
              },
            },
          },
        },
      },
      retriever: {
        rrf: {
          rank_window_size: 100,
          retrievers: [
            {
              standard: {
                query: {
                  sparse_vector: {
                    field: "plot_embedding",
                    inference_id: "my-elser-model",
                    query: "films that explore psychological depths",
                  },
                },
              },
            },
            {
              standard: {
                query: {
                  multi_match: {
                    query: "crime",
                    fields: ["plot", "title"],
                  },
                },
              },
            },
            {
              knn: {
                field: "vector",
                query_vector: [10, 22, 77],
                k: 10,
                num_candidates: 10,
              },
            },
          ],
        },
      },
    },
  },
});
console.log(response);
----
