mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-06-29 02:03:10 -04:00
* chore: generate embeddings * chore: save embedding * chore: vec sqlite * chore: clippy * chore: init vector * chore: create vector db * chore: periodically write embedding * chore: fix compile * chore: skip write * chore: impl search * fix: test * fix: stop scheduler * fix: search * chore: add test * chore: update schema * chore: index all * chore: index * chore: search document content * chore: index document content and title * chore: index all view * chore: rename trait * refactor: remove folder index manager * chore: index folder changes * chore: delete folder search * chore: update logs * chore: update logs * chore: search * chore: add search test * chore: fmt * chore: fix test * chore: fix ios build
25 lines
866 B
SQL
25 lines
866 B
SQL
CREATE VIRTUAL TABLE af_collab_embeddings
|
|
USING vec0(
|
|
workspace_id TEXT NOT NULL,
|
|
object_id TEXT NOT NULL,
|
|
fragment_id TEXT NOT NULL,
|
|
content_type INTEGER NOT NULL,
|
|
content TEXT NOT NULL,
|
|
metadata TEXT,
|
|
fragment_index INTEGER NOT NULL DEFAULT 0,
|
|
embedder_type INTEGER NOT NULL DEFAULT 0,
|
|
embedding float[768]
|
|
);
|
|
|
|
CREATE TABLE af_pending_index_collab
|
|
(
|
|
oid TEXT PRIMARY KEY NOT NULL,
|
|
workspace_id TEXT NOT NULL,
|
|
content TEXT NOT NULL,
|
|
collab_type SMALLINT NOT NULL,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
indexed_at TIMESTAMP DEFAULT NULL
|
|
);
|
|
|
|
-- create index for oid and workspace_id
|
|
CREATE INDEX collab_table_oid_workspace_id_idx ON af_pending_index_collab (oid, workspace_id);
|