rank

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package rank reranks FTS-ranked code-search candidates using dependency-free structural signals (name fuzzy similarity, path proximity), so both the CLI `search` command and the MCP `search` tool share one ranking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchLimit

func FetchLimit(limit int) int

FetchLimit widens the candidate pool pulled from FTS so structural reranking (and any path filtering) has more than the caller's `limit` rows to reorder; the final slice is bounded back to `limit` after reranking. @intent retain enough backend candidates for structural relevance signals to affect the caller's bounded result. @domainRule candidate pools stay between 50 and 500 rows regardless of the requested result limit.

func Rerank

func Rerank(query string, nodes []graph.Node, limit int) []graph.Node

Rerank reorders FTS-ranked search candidates using structural signals fused with the backend rank via Reciprocal Rank Fusion.

@requires nodes is the backend's rank-ordered candidate slice (index == FTS rank). @ensures deterministic output; empty query or empty nodes returns the input bounded by limit, preserving FTS order. @intent combine backend relevance with identifier-name and file-path similarity without losing deterministic FTS tie order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL