logsearch

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooShort = errors.New("search needs a term with three consecutive letters or digits")

Functions

This section is empty.

Types

type Fragment

type Fragment struct {
	Text    string
	Matched bool
}

func Highlight

func Highlight(text string, terms []string) []Fragment

Highlight preserves the original text and merges overlapping matches. Rune positions keep Croatian letters and case mappings with different byte lengths from corrupting the rendered text. Fragments are plain text, never HTML.

type Query

type Query struct {
	Terms             []string
	PrimaryPattern    string
	RemainingPatterns []string
}

Query contains literal, case-insensitive substrings, all of which must match. PrimaryPattern is an explicit ILIKE predicate so PostgreSQL can use pg_trgm; RemainingPatterns are additional filters and may contain shorter terms.

func Parse

func Parse(input string) (Query, error)

Jump to

Keyboard shortcuts

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