Skip to content

feat: add create_index tool for index creation #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

getsolaris
Copy link
Contributor

@getsolaris getsolaris commented Apr 8, 2025

Changes

  • Added new create_index tool to create Elasticsearch indices with mappings and settings
  • Implemented support for custom analyzer configuration
  • Updated README.md with documentation for the new tool
  • Added example queries for index creation in the documentation

Would appreciate any help and suggestions for implementing these improvements !

Using 1

image

Using 2

image

Using 3

image
{
  `index`: `user999`,
  `mappings`: {
    `properties`: {
      `id`: {
        `type`: `integer`
      },
      `job`: {
        `type`: `keyword`
      },
      `name`: {
        `type`: `text`,
        `fields`: {
          `keyword`: {
            `type`: `keyword`
          }
        }
      },
      `email`: {
        `type`: `keyword`
      },
      `phone`: {
        `type`: `keyword`
      },
      `github_id`: {
        `type`: `keyword`
      },
      `created_at`: {
        `type`: `date`
      }
    }
  },
  `settings`: {
    `number_of_shards`: 6,
    `number_of_replicas`: 0
  }
}

Index user999 created successfully with the following configuration:
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": "user999"
}
image

Using 4

image
{
  `index`: `user9999_kr`,
  `mappings`: {
    `properties`: {
      `id`: {
        `type`: `integer`
      },
      `job`: {
        `type`: `keyword`
      },
      `name`: {
        `type`: `text`,
        `fields`: {
          `keyword`: {
            `type`: `keyword`
          }
        }
      },
      `email`: {
        `type`: `keyword`
      },
      `phone`: {
        `type`: `keyword`
      },
      `github_id`: {
        `type`: `keyword`
      },
      `created_at`: {
        `type`: `date`
      }
    }
  },
  `settings`: {
    `analysis`: {
      `analyzer`: {
        `korean_analyzer`: {
          `type`: `standard`,
          `stopwords`: `_korean_`,
          `tokenizer`: `standard`
        }
      }
    },
    `number_of_shards`: 6,
    `number_of_replicas`: 0
  }
}
image

@getsolaris getsolaris requested a review from a team as a code owner April 8, 2025 13:39
@getsolaris getsolaris changed the title feat: create_index tool for index creation feat: add create_index tool for index creation Apr 8, 2025
@jedrazb
Copy link
Member

jedrazb commented Apr 10, 2025

buildkite test this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants