Tearleads

document_search_fts_trigram Client SQLite virtual table

Substring index over document_search_content: the word index's shape with the trigram tokenizer, so a query can match inside words.

Declared in packages/client-sdk/src/data/sqlite/schema/documentSearchSchema.ts

Columns

  • titleuntyped
    • nullable

    Trigram index of the same-named document_search_content column. A match reads the text back from that table's row.

  • structured_textuntyped
    • nullable

    Trigram index of the same-named document_search_content column. A match reads the text back from that table's row.

  • attachment_textuntyped
    • nullable

    Trigram index of the same-named document_search_content column. A match reads the text back from that table's row.

  • body_textuntyped
    • nullable

    Trigram index of the same-named document_search_content column. A match reads the text back from that table's row.

DDL

The statement the client runs to create this index.

CREATE VIRTUAL TABLE IF NOT EXISTS "document_search_fts_trigram" USING fts5(
  title,
  structured_text,
  attachment_text,
  body_text,
  content='document_search_content',
  content_rowid='search_rowid',
  tokenize='trigram remove_diacritics 1'
);