24 lines
567 B
Go
24 lines
567 B
Go
package main
|
|
|
|
import "context"
|
|
|
|
type fts5Engine struct {
|
|
sqlite *sqliteStore
|
|
}
|
|
|
|
func newFTS5Engine(sqlite *sqliteStore) *fts5Engine {
|
|
return &fts5Engine{sqlite: sqlite}
|
|
}
|
|
|
|
func (e *fts5Engine) Index(ctx context.Context, id, _ int64, _ int, note string) error {
|
|
return e.sqlite.indexFTS(ctx, id, note)
|
|
}
|
|
|
|
func (e *fts5Engine) Delete(ctx context.Context, id, _ int64) error {
|
|
return e.sqlite.deleteFTS(ctx, id)
|
|
}
|
|
|
|
func (e *fts5Engine) Search(ctx context.Context, query string, limit uint64) ([]searchResult, error) {
|
|
return e.sqlite.searchFTS(ctx, query, limit)
|
|
}
|