{"modulePath":"github.com/matrixorigin/matrixone","version":"v0.0.0-debug-20260702","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runtime\n\nPackage runtime holds the fulltext index's catalog-side metadata. Fulltext fits the catalog hook contract cleanly even though it parses to \\*tree.FullTextIndex (handled separately by BuildFullTextIndexDefs): it has a single hidden table, no op-types, and async CDC support.\n\n## Types\n\n```go\ntype CatalogHooks struct{}\n```\nCatalogHooks implements plugin/catalog.Hooks for fulltext indexes.\n\n```go\nfunc (CatalogHooks) AlterTableCloneBehavior() catalogplugin.AlterTableCloneBehavior\n```\nAlterTableCloneBehavior — fulltext's single hidden table is empty at CREATE-INDEX time (rows land via the populate step or CDC), so no DELETE before clone is needed. Async fulltext is skipped at the whole-index level via SyncDescriptor, not per table.\n\n```go\nfunc (CatalogHooks) BuildSessionVars() []string\n```\nBuildSessionVars — fulltext's tokenizing build reads no algorithm-specific session vars and has no experimental flag; persist only the basic lower\\_case\\_table\\_names (table-name resolution in the rebuild SQL). BuildSessionVars returns nil — fulltext captures no session vars into algo\\_params, keeping its algo\\_params byte-compatible with pre-session\\_vars indexes.\n\n```go\nfunc (CatalogHooks) DefaultOptions() map[string]string\n```\nDefaultOptions — fulltext defaults are inferred at build time; no statement-level option JSON is required when the WITH(...) clause is omitted. Matches the legacy catalog.IndexParamsToJsonString path returning \"\" for an empty option map.\n\n```go\nfunc (CatalogHooks) ExperimentalFlag() string\n```\nExperimentalFlag — \\`experimental\\_fulltext\\_index\\` exists at pkg/frontend/variables.go but is not enforced anywhere today. Returning \"\" preserves that behavior.\n\n```go\nfunc (CatalogHooks) HiddenTableTypes() []string\n```\nHiddenTableTypes — fulltext uses a single hidden table holding (doc\\_id, pos, word) rows clustered by word.\n\n```go\nfunc (CatalogHooks) ParamsFromTree(_ *tree.Index) (map[string]string, error)\n```\nParamsFromTree — fulltext parses to \\*tree.FullTextIndex, not \\*tree.Index, so this hook is never reached for fulltext in practice. The fulltext-specific parser lives at pkg/fulltext/plugin/plan/schema.go::buildFullTextParams and is invoked from BuildFullTextIndexDefs.\n\n```go\nfunc (h CatalogHooks) RestoreBehavior() catalogplugin.RestoreBehavior\n```\nRestoreBehavior — CreateTable populates fulltext's inverted-index hidden table inline for a sync index (CROSS APPLY fulltext\\_index\\_tokenize), and the restore's block-level clone APPENDS, so it must be emptied with DELETE … WHERE TRUE before the clone re-supplies it — DeleteBeforeClone is the hidden table. (For an async index the table is empty at CreateTable, so the delete is a harmless no-op.) The compile hook's RestoreInitSQL returns \"\" — no reindex; clone + CDC catch-up rebuild it.\n\n```go\nfunc (CatalogHooks) ShouldTruncateHiddenTable(_ string) bool\n```\nShouldTruncateHiddenTable — fulltext has no preserved-across-truncate state; the single hidden table is rebuilt from source rows.\n\n```go\nfunc (CatalogHooks) SupportedIncludeColumnTypes() []types.T\n```\nSupportedOpTypes — fulltext has no metric/op-type concept. SupportedIncludeColumnTypes: this index has no INCLUDE-column support.\n\n```go\nfunc (CatalogHooks) SupportedOpTypes() map[string]string\n```\n\n```go\nfunc (CatalogHooks) SupportedPrimaryKeyTypes() []types.T\n```\nSupportedPrimaryKeyTypes: fulltext imposes no PK-type constraint.\n\n```go\nfunc (CatalogHooks) SupportedVectorTypes() []types.T\n```\nSupportedVectorTypes: fulltext has no vector column.\n\n```go\nfunc (CatalogHooks) SyncDescriptor() catalogplugin.SyncDescriptor\n```\nSyncDescriptor — fulltext participates in ISCP CDC when the index is async (per the Async param in IndexAlgoParams). No idxcron action today, matching the legacy inline behaviour.\n\n","path":"github.com/matrixorigin/matrixone/pkg/fulltext/plugin/runtime","name":"runtime","synopsis":"Package runtime holds the fulltext index's catalog-side metadata.","isRedistributable":true}
