Commit 864163d
fix(search): replace placeholder data returns with Atlas SDK limitati… (#5)
* fix(search): replace placeholder data returns with Atlas SDK limitation errors (#4)
Replace all placeholder data implementations in search service methods with
proper error messages that inform users about Atlas Admin API limitations.
**Changes Made:**
- Modified `GetSearchAnalyzers()` to return error instead of placeholder data
- Modified `GetSearchFacets()` to return error instead of placeholder data
- Removed helper functions that contained placeholder implementations:
- `extractAnalyzersFromDefinition()`
- `extractFacetsFromDefinition()`
- `analyzeIndexDefinition()`
- Updated error messages to guide users to Atlas UI for unsupported features
**Affected Methods:**
- `GetSearchAnalyzers`: Returns error about SDK not exposing analyzer details
- `GetSearchFacets`: Returns error about SDK not exposing facet details
- `GetSearchMetrics`: Already properly returns limitation error (unchanged)
- `AnalyzeSearchIndex`: Already properly returns limitation error (unchanged)
- `ValidateSearchQuery`: Already properly returns limitation error (unchanged)
**Error Message Pattern:**
All errors now follow consistent format:
1. Structured logging with context (project_id, cluster_name, reason)
2. Clear error message explaining the Atlas SDK limitation
3. Guidance to use Atlas UI for the specific functionality
**Files Modified:**
- `internal/services/atlas/search.go`: Core service method changes (-84 lines)
- `cmd/atlas/search/search.go`: Minor comment updates
- `internal/output/advanced_search.go`: Retained placeholder handling for compatibility
**Backward Compatibility:** Yes - methods still exist but now return informative errors
This change prevents users from receiving misleading placeholder data and
provides clear guidance on how to access these features through the Atlas UI.
Refs: Atlas SDK limitation handling
Co-authored-by: Danny Teller <danny.teller@tipalti.com>
* fix: go formatting
---------
Co-authored-by: Danny Teller <danny.teller@tipalti.com>1 parent 58a5188 commit 864163d
File tree
15 files changed
+1593
-253
lines changed- cmd
- atlas/clusters
- infra
- docs
- examples
- examples
- features
- internal
- apply
- types
- scripts
- test
15 files changed
+1593
-253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | 13 | | |
6 | 14 | | |
| |||
0 commit comments