search

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package search handles vector similarity search for repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SearchFilters

type SearchFilters struct {
	Language *string
	Starred  *bool
	Owned    *bool
	Owner    *string
	Limit    int // default 3
}

SearchFilters contains optional filters for search queries.

type SearchQueryResult

type SearchQueryResult struct {
	Results          []SearchResult
	TotalConsidered  int
	QueryEmbeddingMs int64
	SearchMs         int64
}

SearchQueryResult contains the search results and timing metrics.

func SearchRepos

func SearchRepos(ctx context.Context, db *sql.DB, embedProvider provider.EmbeddingProvider, query string, filters SearchFilters) (SearchQueryResult, error)

SearchRepos embeds the query and performs a cosine similarity search against chunk_embeddings. Results are deduplicated by repo (highest similarity chunk per repo), then capped at Limit.

type SearchResult

type SearchResult struct {
	RepoFullName string
	Owner        string
	RepoName     string
	Description  string
	Language     string
	Stars        int
	IsStarred    bool
	IsOwned      bool
	HTMLURL      string
	ChunkType    string
	Content      string
	Similarity   float64
}

SearchResult represents a single search result.

Jump to

Keyboard shortcuts

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