-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
i use the following code because the default embedding only support one column
CREATE OR REPLACE FUNCTION update_article_fts_embedding()
RETURNS TRIGGER AS $$
BEGIN
NEW.fts_embedding := tokenize( COALESCE(NEW.title, '') || ' ' || COALESCE(NEW.content, '') ,'bert');
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
-- Create a trigger that calls the function before an existing row is updated.
-- This ensures the index stays current if the title, content, or link changes.
CREATE TRIGGER article_update_trigger
BEFORE UPDATE ON article
FOR EACH ROW
EXECUTE FUNCTION update_article_fts_embedding();
this will make vectorchord error out with range start index 18446744073709551600 out of range for slice of length 0
when the row is changed but NEW.title and NEW.content remains the same.
and it's a bit strange that the number is always 18446744073709551600. my content may contain extremely long token, i wonder if that could be the cause
Metadata
Metadata
Assignees
Labels
No labels