Supercharged OpenSearch Tools for VS CodeFor engineers building with OpenSearch; or looking for easier way to maintain OpenSearch in production. This extension for VSCode brings a supercharged OpenSearch Dashboards DevTools-like functionality directly into your editor, along with advanced query and index mapping editing, mock-data generator, snippets, and more. Fully supporting all modern OpenSearch versions, running anywhere (Amazon OpenSearch Service and self-managed), with smart configuration management and Cloud ID support. 🚀 What's Inside?🛠️ OpenSearch Dashboards DevTools-like Interface
Example usage:
🔍 Advanced Query Editor
🗺️ Index Mapping Editor
🎲 Mock Data Generator
More Coming Soon📦 InstallationFrom VS Code Marketplace
🎯 Quick Start1. Configure OpenSearch Connection (optional)If you want to use DevTools, you'd need to set up a connection to a cluster. This extension supports only one connection at a time.
The configuration dialog will open with the following options:
Note: If no configuration is set, a warning banner will appear in 2. Create Your First Query FileDevTools-style HTTP queries (
|
Shortcut | Action | Context |
---|---|---|
Cmd/Ctrl+Enter |
Execute Query | .os.http , .os.query.json files |
Cmd/Ctrl+Shift+F |
Format Query | .os.query.json files |
Cmd/Ctrl+Shift+D |
Open DevTools Panel | Global |
🎛️ Commands
Command | Description | Context |
---|---|---|
OpenSearch: Configure Connection |
Open configuration dialog | Global |
OpenSearch: Execute Query |
Execute current query | .os.http , .os.query.json files |
OpenSearch: Format Query |
Format JSON query | .os.query.json files |
OpenSearch: Wrap in Bool Filter |
Wrap selection in bool filter clause | .os.query.json files |
OpenSearch: Wrap in Bool Should |
Wrap selection in bool should clause | .os.query.json files |
OpenSearch: Wrap in Bool Must Not |
Wrap selection in bool must_not clause | .os.query.json files |
OpenSearch: Open OpenSearch DevTools |
Open DevTools panel | Global |
OpenSearch: Generate Mock Data from Mapping |
Generate realistic test data from mapping | .os.mapping.json files |
🎨 File Types & Features
.os.http
- DevTools HTTP Files
- Purpose: OpenSearch Dashboards DevTools-like interface for HTTP requests
- Features:
- HTTP method support (GET, POST, PUT, DELETE)
- Auto-completion for OpenSearch API endpoints
- Cluster management operations (health, stats, nodes)
- Index operations (CRUD, mappings, settings)
- Advanced features (ISM, snapshots, security)
- Snippets: 80+ snippets for all OS operations (
os-get-health
,os-put-ism-policy
) - Usage: DevTools-style queries with request/response separation
.os.query.json
- OpenSearch Query Files
- Purpose: Valid JSON files for OpenSearch queries and aggregations
- Features:
- Full IntelliSense with query and aggregation completion
- Query validation and JSON formatting
- Bool query wrapping shortcuts (filter, should, must_not)
- Real-time syntax validation
- Snippets: 50+ query and aggregation snippets (
os-match
,os-bool
,os-agg-terms
) - Usage: Pure JSON query development with execution support
.os.mapping.json
- Index Mapping Files
- Purpose: Valid JSON files for OpenSearch index mappings
- Features:
- Comprehensive mapping validation
- Field type checking and recommendations
- Best practices analysis
- Mock data generation from mappings (Command Palette or right-click context menu)
- Snippets: 30+ field type and mapping snippets (
os-field-text
,os-mapping-complete
) - Usage: Index mapping design and validation
🎯 Use Cases
Development Workflow
- Design mappings using
.os.mapping.json
files with validation - Generate mock data from mappings for testing
- Develop queries using
.os.query.json
files with IntelliSense - Test APIs using
.os.http
files in DevTools style - Explore data using the tabular data viewer
Query Development
- Build complex bool queries with easy wrapping shortcuts
- Test aggregations with auto-completion
- Format and validate queries before deployment
- Export results for analysis
Data Exploration
- Browse index data in tabular format
- Search and filter documents
- Examine index mappings and settings
- Generate sample data for development
🐛 Troubleshooting
Common Issues
Connection Refused
- Verify OpenSearch is running
- Check hosts configuration in settings
- Ensure SSL certificates are valid
- Verify authentication credentials if required
Configuration Warning Banner Appears
- Open Command Palette and run "OpenSearch: Configure Connection"
- Add your OpenSearch hosts or AWS endpoint
- Ensure at least one non-default host is configured
Queries Not Executing
- Check OpenSearch configuration in settings
- Verify hosts are accessible and authentication is correct
- Check query syntax and formatting
- Verify index names exist
IntelliSense Not Working
- Ensure file has correct extension (
.os.query.json
,.os.http
) - Reload VS Code window
- Check extension is enabled
AWS OpenSearch Service Issues
- Verify AWS credentials are configured
- Check that IAM roles have proper permissions
- Ensure VPC/security groups allow access if applicable
Mock Data Generation Fails
- Validate mapping JSON syntax
- Check for unsupported field types
- Ensure reasonable document count (<10,000)
Debug Mode
Enable debug logging:
{
"opensearch.debug": true
}
View logs in:
- Output Panel: "OpenSearch Query Results"
- Developer Tools: Help > Toggle Developer Tools
🔗 Links
- OpenSearch Documentation
- Amazon OpenSearch Service
- OpenSearch Documentation and Guides
- OpenSearch Support
Happy searching! 🔍✨