Documentation
¶
Overview ¶
Package search provides search functionality via the Entire search service.
Index ¶
- Constants
- func ParseGitHubRemote(remoteURL string) (owner, repo string, err error)
- func ValidateRepoFilters(repos []string) error
- type CheckpointResult
- type CommitResult
- type Config
- type Meta
- type ParsedInput
- type Response
- type Result
- func (r *Result) MarshalJSON() ([]byte, error)
- func (r *Result) ResultAuthor() string
- func (r *Result) ResultBranch() string
- func (r *Result) ResultCreatedAt() string
- func (r *Result) ResultID() string
- func (r *Result) ResultOrg() string
- func (r *Result) ResultRepo() string
- func (r *Result) ResultTitle() string
- func (r *Result) UnmarshalJSON(b []byte) error
- type SessionResult
- type Timing
- type TypeCounts
Constants ¶
const ( TypeCheckpoint = "checkpoint" TypeCommit = "commit" TypeSession = "session" )
Result type constants.
const AllReposFilter = "*"
AllReposFilter is the inline repo filter value that disables repo scoping.
const DefaultLimit = 100
DefaultLimit is the default number of results to fetch per request, matching the UI.
const DefaultServiceURL = "https://entire.io"
DefaultServiceURL is the production search service URL.
const MaxLimit = 200
MaxLimit is the maximum number of results the search API will return per request.
const WildcardQuery = "*"
WildcardQuery is the query string used when only filters are provided (no search terms).
Variables ¶
This section is empty.
Functions ¶
func ParseGitHubRemote ¶
ParseGitHubRemote extracts owner and repo from a git remote URL that resolves to GitHub. It accepts direct GitHub remotes (SCP-style SSH, ssh://, and https://) as well as Entire mirror remotes (entire://host/gh/owner/repo), whose forge prefix maps back to github.com. Remotes resolving to any other host, or whose path holds extra segments beyond owner/repo, are rejected.
func ValidateRepoFilters ¶
ValidateRepoFilters ensures repo filters match backend semantics.
Types ¶
type CheckpointResult ¶
type CheckpointResult struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
CommitMessage *string `json:"commitMessage"`
CommitSubject *string `json:"commitSubject"`
CommitSHA *string `json:"commitSha"`
Branch string `json:"branch"`
Org string `json:"org"`
Repo string `json:"repo"`
Author string `json:"author"`
AuthorUsername *string `json:"authorUsername"`
CreatedAt string `json:"createdAt"`
FilesTouched []string `json:"filesTouched"`
}
CheckpointResult represents a checkpoint returned by the search service.
type CommitResult ¶ added in v0.7.6
type CommitResult struct {
ID string `json:"id"`
CommitSHA string `json:"commitSha"`
CommitMessage string `json:"commitMessage"`
CommitSubject string `json:"commitSubject"`
Branch string `json:"branch"`
Org string `json:"org"`
Repo string `json:"repo"`
Author string `json:"author"`
AuthorUsername *string `json:"authorUsername"`
CreatedAt string `json:"createdAt"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
FilesChanged int `json:"filesChanged"`
HTMLUrl *string `json:"htmlUrl"`
}
CommitResult represents a commit returned by the search service.
type Config ¶
type Config struct {
ServiceURL string // Base URL of the search service
GitHubToken string
Owner string
Repo string
Repos []string
AllRepos bool // When true, search all accessible repos (no repo scoping)
Query string
Limit int
Author string // Filter by author name
Date string // Filter by time period: "week" or "month"
Branch string // Filter by branch name
Page int // 1-based page number (0 means omit, API defaults to 1)
}
Config holds the configuration for a search request.
func (Config) HasFilters ¶
HasFilters reports whether any filter fields are set on the config.
type Meta ¶
type Meta struct {
MatchType string `json:"matchType"`
Score float64 `json:"score"`
Tier *int `json:"tier,omitempty"`
Snippet string `json:"snippet,omitempty"`
Summary string `json:"summary,omitempty"`
BM25Score *float64 `json:"bm25Score,omitempty"`
ANNScore *float64 `json:"annScore,omitempty"`
}
Meta contains search ranking metadata for a result.
type ParsedInput ¶
ParsedInput holds the parsed query and optional filters extracted from search input.
func ParseSearchInput ¶
func ParseSearchInput(raw string) ParsedInput
ParseSearchInput extracts filter prefixes from raw input. Supports quoted values for single-value filters, for example: author:"alice smith". Remaining tokens become the query.
type Response ¶
type Response struct {
Results []Result `json:"results"`
Total int `json:"total"`
Page int `json:"page"`
Error string `json:"error,omitempty"`
Timing *Timing `json:"timing,omitempty"`
Reranked *bool `json:"reranked,omitempty"`
Counts *TypeCounts `json:"counts,omitempty"`
}
Response is the search service response.
type Result ¶
type Result struct {
Type string `json:"-"`
Meta Meta `json:"-"`
Checkpoint *CheckpointResult `json:"-"`
Commit *CommitResult `json:"-"`
Session *SessionResult `json:"-"`
// contains filtered or unexported fields
}
Result wraps a search result with its type and ranking metadata. Exactly one of Checkpoint, Commit, or Session is non-nil based on Type.
func (*Result) MarshalJSON ¶ added in v0.7.6
MarshalJSON implements custom JSON marshaling to produce the API wire format.
func (*Result) ResultAuthor ¶ added in v0.7.6
ResultAuthor returns the display author for any result type.
func (*Result) ResultBranch ¶ added in v0.7.6
ResultBranch returns the branch for any result type.
func (*Result) ResultCreatedAt ¶ added in v0.7.6
ResultCreatedAt returns the createdAt for any result type.
func (*Result) ResultRepo ¶ added in v0.7.6
ResultRepo returns the repo for any result type.
func (*Result) ResultTitle ¶ added in v0.7.6
ResultTitle returns the primary display text for any result type.
func (*Result) UnmarshalJSON ¶ added in v0.7.6
UnmarshalJSON implements custom JSON unmarshaling to parse typed data.
type SessionResult ¶ added in v0.7.6
type SessionResult struct {
SessionID string `json:"sessionId"`
DisplayName string `json:"displayName"`
Prompt *string `json:"prompt"`
Agent *string `json:"agent"`
Model *string `json:"model"`
StepCount int `json:"stepCount"`
Org string `json:"org"`
Repo string `json:"repo"`
Branch *string `json:"branch"`
AuthorUsername *string `json:"authorUsername"`
CreatedAt string `json:"createdAt"`
}
SessionResult represents a session returned by the search service.
type Timing ¶ added in v0.7.6
type Timing struct {
TotalMs *float64 `json:"total_ms"`
KeywordMs *float64 `json:"keyword_ms"`
EmbeddingMs *float64 `json:"embedding_ms"`
VectorMs *float64 `json:"vector_ms"`
RerankMs *float64 `json:"rerank_ms"`
FanoutMs *float64 `json:"fanout_ms"`
SessionHydrationMs *float64 `json:"session_hydration_ms"`
}
Timing holds search performance timing data.