document

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

@index Pure search-document content construction from graph nodes and annotations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContent

func BuildContent(node graph.Node, annotations map[uint]*graph.Annotation) string

BuildContent assembles the text indexed for one node's search document. @intent combine symbol names, path/language tokens, and annotation evidence without persistence concerns.

func BuildReasons added in v0.13.1

func BuildReasons(node graph.Node, annotations map[uint]*graph.Annotation) []string

BuildReasons lists the texts indexed for one node's recorded reasons, one entry per reason.

This is deliberately not BuildContent with a filter. BuildContent answers "what is this called", so it mixes the identifier, its split subtokens, and the path into the same text as the annotation prose. A question like "why do we verify the webhook signature" then competes against every node whose *name* happens to contain a query word. Keeping the reason in its own index is what lets that question be scored on the reason alone.

One entry per reason rather than one joined string per node, because scoring gives a long document less credit per word. Joined, a node's @intent was scored on its own length plus the length of every @domainRule beside it, so rules the question never touched cost the intent that answered it much of its score. Separated, a question that matches one reason is scored on that reason's length and nothing else.

Which tag kinds count as a reason is now a list rather than a trade. Adding a kind used to lengthen every existing document on that node and cost it score; now it only adds documents beside them. reasonKinds is where that decision lives. @intent index each reason a node exists as its own document, so writing one reason down never costs another its score. @return returns one entry per recorded reason in tag order, and nothing when no reason was recorded.

Types

type Maintenance

type Maintenance interface {
	RefreshDocuments(ctx context.Context) (int, error)
	RebuildIndex(ctx context.Context) error
}

Maintenance refreshes persisted search documents and the bound full-text index. @intent let inbound orchestration trigger one complete search rebuild without receiving database/backend handles.

Jump to

Keyboard shortcuts

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