Skip to content

Wave 4a: Multi-layer intersection logic #198

Description

@dean0x

Overview

Compose search results across all three layers via intersection and re-ranking.

Module: crates/rskim-search/src/compound/intersection.rs (~150 lines)

Algorithm

  • Each layer returns Vec<(FileId, Score)>
  • Lexical + AST → intersect (keep only files in both)
  • Temporal → re-rank (multiply/adjust scores, don't filter)
  • Empty intersection → empty results (not error)

Dependencies

Acceptance Criteria

  • text AND ast returns only files matching both
  • Temporal re-ranking preserves result set, changes ordering
  • Single-layer queries work (no mandatory intersection)

Implementation Guidelines Checklist

  • No file exceeds 400 lines
  • Every public function has /// doc comment
  • All dependencies injected
  • All fallible operations return Result<T, SearchError>
  • Module has #[cfg(test)] mod tests

Wave 3g (#199) follow-up:

#199 ships an interim file-set filter: the AST-matching FileId set is applied as `file_filter` on the lexical query (lexical ranking/snippets/line numbers preserved; AST acts as a pure filter, no composite re-ranking). #198 should formalize true intersection + composite cross-layer ranking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    searchCode search featurewave-4Wave 4: Compound queries

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions