// 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.indices.create({
  index: "place",
  mappings: {
    properties: {
      suggest: {
        type: "completion",
        contexts: [
          {
            name: "place_type",
            type: "category",
          },
          {
            name: "location",
            type: "geo",
            precision: 4,
          },
        ],
      },
    },
  },
});
console.log(response);

const response1 = await client.indices.create({
  index: "place_path_category",
  mappings: {
    properties: {
      suggest: {
        type: "completion",
        contexts: [
          {
            name: "place_type",
            type: "category",
            path: "cat",
          },
          {
            name: "location",
            type: "geo",
            precision: 4,
            path: "loc",
          },
        ],
      },
      loc: {
        type: "geo_point",
      },
    },
  },
});
console.log(response1);
----
