Documentation
¶
Overview ¶
Package search provides full-text search using SQLite FTS5
Index ¶
- type AdvancedQuery
- type Query
- type Result
- type Searcher
- func (s *Searcher) BuildFTS5Query(q *AdvancedQuery) string
- func (s *Searcher) Close() error
- func (s *Searcher) GetMatch(resultType, id string) (string, error)
- func (s *Searcher) IndexOutput(outputID, taskID, agentType, output string) error
- func (s *Searcher) IndexTask(taskID, title, description string) error
- func (s *Searcher) InitSchema() error
- func (s *Searcher) ParseAdvancedQuery(queryStr string) (*AdvancedQuery, error)
- func (s *Searcher) Search(query Query) ([]*Result, error)
- func (s *Searcher) SetLogger(logger *log.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedQuery ¶
type AdvancedQuery struct {
// Boolean operators
AND []string
OR []string
NOT []string
// Phrase matching
Phrases []string
// Prefix matching
Prefixes []string
// Filters
MinDate int64
MaxDate int64
}
AdvancedQuery supports boolean operators and phrase matching
type Query ¶
type Query struct {
Query string `json:"query"`
Limit int `json:"limit"`
Offset int `json:"offset"`
TypeFilter string `json:"type_filter"` // "task", "output", "epic", or "all"
}
Query represents a search query
type Result ¶
type Result struct {
Type string `json:"type"` // "task", "output", "epic"
ID string `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Match string `json:"match"` // Highlighted match snippet
Rank float64 `json:"rank"` // FTS5 rank score
ProjectID string `json:"project_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
Timestamp int64 `json:"timestamp"`
}
Result represents a search result
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
Searcher provides full-text search capabilities
func NewSearcher ¶
NewSearcher creates a new searcher instance
func (*Searcher) BuildFTS5Query ¶
func (s *Searcher) BuildFTS5Query(q *AdvancedQuery) string
BuildFTS5Query builds an FTS5 query from an AdvancedQuery
func (*Searcher) IndexOutput ¶
IndexOutput indexes an agent output in the FTS5 table
func (*Searcher) InitSchema ¶
InitSchema creates the FTS5 virtual tables
func (*Searcher) ParseAdvancedQuery ¶
func (s *Searcher) ParseAdvancedQuery(queryStr string) (*AdvancedQuery, error)
ParseAdvancedQuery parses a complex search query with operators
Click to show internal directories.
Click to hide internal directories.