searchrank

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package searchrank 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.

func Rerank

func Rerank(query string, nodes []model.Node, limit int) []model.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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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