Skip to content

Conversation

@dluc
Copy link
Collaborator

@dluc dluc commented Dec 2, 2025

Summary

Fixes the known issue "Index Weights Not Configurable" - index weights for reranking can now be configured per-index instead of using hardcoded defaults.

Changes

  • src/Core/Search/SearchService.cs: Added indexWeights constructor parameter, updated BuildRerankingConfig to use configured weights
  • src/Main/CLI/Commands/SearchCommand.cs: Extract weights from NodeConfig.SearchIndexes and pass to SearchService
  • tests/Core.Tests/Search/SearchServiceIndexWeightsTests.cs: 6 new unit tests
  • KNOWN-ISSUES.md: Removed the resolved issue

Configuration Example

Users can now configure index weights in ~/.km/config.json:

{
  "nodes": {
    "personal": {
      "searchIndexes": [
        {
          "id": "sqlite-fts",
          "type": "sqliteFTS",
          "weight": 0.7
        },
        {
          "id": "vector-main",
          "type": "sqliteVector",
          "weight": 0.3
        }
      ]
    }
  }
}

Test plan

  • All 530 tests pass (316 Core + 214 Main)
  • Zero skipped tests
  • Code coverage at 83.93% (above 80% threshold)
  • build.sh passes with 0 warnings
  • format.sh passes
  • coverage.sh passes

Backward Compatibility

Fully backward compatible - missing weights default to SearchConstants.DefaultIndexWeight (1.0).

Index weights for reranking can now be configured per-index instead of
using hardcoded defaults. Weights are read from SearchIndexConfig.Weight
property in the node configuration.

Changes:
- Add indexWeights parameter to SearchService constructor
- Extract weights from NodeConfig.SearchIndexes in SearchCommand
- Add 6 unit tests for index weight configuration
- Remove known issue "Index Weights Not Configurable" from KNOWN-ISSUES.md
@dluc dluc merged commit 2dde39e into main Dec 2, 2025
7 checks passed
@dluc dluc deleted the fix-index-weights-config branch December 2, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants