refactor: extract ES-compat handler logic into reusable functions#6271
Merged
refactor: extract ES-compat handler logic into reusable functions#6271
Conversation
…nctions Extract JSON construction from warp handlers into standalone functions that can be called directly without HTTP, enabling non-HTTP consumers (e.g., gRPC passthrough) to reuse the ES-compatible logic. Extracted functions: - es_compat_cluster_info, es_compat_nodes_info, es_compat_search_shards, es_compat_aliases, es_compat_cluster_health_check, es_compat_delete_scroll Made pub(crate): es_compat_index_mapping, es_compat_index_search, es_compat_index_count, es_compat_index_stats, es_compat_cat_indices, es_compat_index_cat_indices, es_compat_resolve_index, es_compat_index_field_capabilities, es_compat_index_multi_search, es_scroll Also made model and rest_handler modules pub(crate) in mod.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
guilload
approved these changes
Apr 7, 2026
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.
Summary
pub(crate)functions callable without HTTPmodelandrest_handlermodulespub(crate)inmod.rsMotivation
Downstream consumers need to call ES-compatible handler logic directly (without a network round-trip through warp). This refactoring extracts the core logic into reusable functions while keeping existing HTTP handlers working identically.
Changes
Extracted new functions:
es_compat_cluster_info— cluster info JSONes_compat_nodes_info— nodes info JSONes_compat_search_shards— search shards JSONes_compat_aliases— empty aliases objectes_compat_cluster_health_check— cluster health checkes_compat_delete_scroll— scroll delete responseMade
pub(crate):es_compat_index_mapping,es_compat_index_search,es_compat_index_count,es_compat_index_stats,es_compat_cat_indices,es_compat_index_cat_indices,es_compat_resolve_index,es_compat_index_field_capabilities,es_compat_index_multi_search,es_scroll,ElasticsearchCountResponseTest plan
cargo +nightly fmtclean🤖 Generated with Claude Code