search

package
v0.0.0-...-03259da Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package search implements the searching in a given database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Score        float64
	MatchedWords map[string][]string
}

Answer contains additional information of an search results answer

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database manages the updates needed to drive the text index.

func NewDatabase

func NewDatabase(cfg *config.Config) *Database

NewDatabase creates a new database,

type QueryServer

type QueryServer struct {
	// contains filtered or unexported fields
}

QueryServer manages incoming queries against the database.

func NewQueryServer

func NewQueryServer(cfg *config.Config, ti *TextIndex) (*QueryServer, error)

NewQueryServer creates a new query server with the help of a text index.

func (*QueryServer) Query

func (qs *QueryServer) Query(q string, collections []string, meeting int) (answers map[string]Answer, err error)

Query searches the database for hits. Returns a list of fqids.

func (*QueryServer) Run

func (qs *QueryServer) Run(ctx context.Context)

Run starts the query server.

type TextIndex

type TextIndex struct {
	// contains filtered or unexported fields
}

TextIndex manages a text index over a given database.

func NewTextIndex

func NewTextIndex(
	cfg *config.Config,
	db *Database,
	collections meta.Collections,
) (*TextIndex, error)

NewTextIndex creates a new text index.

func (*TextIndex) Close

func (ti *TextIndex) Close() error

Close tears down an open text index.

func (*TextIndex) Search

func (ti *TextIndex) Search(question string, collections []string, meetingID int) (map[string]Answer, error)

Search queries the internal index for hits.

Jump to

Keyboard shortcuts

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