Problem
Currently, list_indices only discovers indices by looking for aliases ending with -repo. However, the semantic-code-search-indexer doesn't automatically create such aliases when indexing a repository. This creates a workflow issue where users must manually:
- Create an index with
<index>-repo name
- Add a
<index>-repo alias
This is a design omission that makes the tool less user-friendly.
Solution
Implement a dual discovery strategy:
- Primary: Continue to discover indices via aliases ending with
-repo (backward compatible)
- Fallback: Discover indices by finding all indices ending with
_settings, extracting the base name, and verifying the base index exists
The indexer creates both <name> and <name>_settings indices, so we can identify repos by the _settings pattern.
Implementation
- Add
discoverRepoIndicesFromAliases() function (primary strategy)
- Add
discoverRepoIndicesFromSettings() function (fallback strategy)
- Merge and deduplicate results (aliases take precedence for display names)
- Update both
listIndices() and getAvailableIndices() to use the same discovery logic
- Add comprehensive test coverage including console.warn verification
Benefits
- Works immediately with current indexer behavior (no manual alias creation needed)
- Maintains backward compatibility with existing
-repo aliases
- Provides clear migration path for future indexer improvements
- Future-proof: works with both old and new indexer versions
Problem
Currently,
list_indicesonly discovers indices by looking for aliases ending with-repo. However, thesemantic-code-search-indexerdoesn't automatically create such aliases when indexing a repository. This creates a workflow issue where users must manually:<index>-reponame<index>-repoaliasThis is a design omission that makes the tool less user-friendly.
Solution
Implement a dual discovery strategy:
-repo(backward compatible)_settings, extracting the base name, and verifying the base index existsThe indexer creates both
<name>and<name>_settingsindices, so we can identify repos by the_settingspattern.Implementation
discoverRepoIndicesFromAliases()function (primary strategy)discoverRepoIndicesFromSettings()function (fallback strategy)listIndices()andgetAvailableIndices()to use the same discovery logicBenefits
-repoaliases