Add index creating from existing index - #17
Open
volynvlad wants to merge 8 commits into
Open
Conversation
Owner
|
Hi @volynvlad, Thanks for your contribution. |
cr7258
reviewed
Apr 10, 2025
Comment on lines
+1
to
+12
| __all__ = [ | ||
| "UnsupportedEngineException", | ||
| ] | ||
|
|
||
|
|
||
| class UnsupportedEngineException(Exception): | ||
| def __init__(self, message: str) -> None: | ||
| self.message = message | ||
| super().__init__(self.message) | ||
|
|
||
| def __str__(self) -> str: | ||
| return self.message |
Owner
There was a problem hiding this comment.
How about merging src/clients/exceptions.py and src/exceptions.py into one file?
Comment on lines
-52
to
-58
| def elasticsearch_mcp_server(): | ||
| """Entry point for Elasticsearch MCP server.""" | ||
| run_search_server(engine_type="elasticsearch") | ||
|
|
||
| def opensearch_mcp_server(): | ||
| """Entry point for OpenSearch MCP server.""" | ||
| run_search_server(engine_type="opensearch") |
Owner
There was a problem hiding this comment.
We need to keep the elasticsearch_mcp_server and opensearch_mcp_server functions because they are defined as the entry point in the pyproject.toml.
User can use uv run elasticsearch-mcp-server or uv run opensearch-mcp-server to start the mcp server.
cr7258
reviewed
Apr 10, 2025
| return self.search_client.create_index(index=index, body=body) | ||
|
|
||
| @mcp.tool(description="Create new index with the same mapping as existing_index") | ||
| def create_index_copy(index: str, existing_index: str) -> list[TextContent]: |
Owner
There was a problem hiding this comment.
Could you please update this new tool create_index_copy in the README?
https://github.com/cr7258/elasticsearch-mcp-server?tab=readme-ov-file#index-operations
Co-authored-by: Se7en <chengzw258@163.com>
Co-authored-by: Se7en <chengzw258@163.com>
Co-authored-by: Se7en <chengzw258@163.com>
Co-authored-by: Se7en <chengzw258@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
create_index_copy(index: str, existing_index: str) -> list[TextContent]forIndexToolsget_settings,get_mappingsforIndexClientclassSearchClientBase is an abstract base class, but it has no abstract methods or properties