// 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: "kibana_sample_data_ecommerce",
  runtime_mappings: {
    price_range: {
      type: "keyword",
      script: {
        source:
          "\n           def bucket_start = (long) Math.floor(doc['taxful_total_price'].value / 50) * 50;\n           def bucket_end = bucket_start + 50;\n           emit(bucket_start.toString() + \"-\" + bucket_end.toString());\n        ",
      },
    },
  },
  size: 0,
  aggs: {
    my_agg: {
      frequent_item_sets: {
        minimum_set_size: 4,
        fields: [
          {
            field: "category.keyword",
          },
          {
            field: "price_range",
          },
          {
            field: "geoip.city_name",
          },
        ],
        size: 3,
      },
    },
  },
});
console.log(response);
----
