refactor: SearchEngine interface, remove nilable qdrantStore
This commit is contained in:
1 parent
98aa7dd68c
commit
ffdc023065
5 files changed
+134
-118
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user