diff --git a/.changeset/good-bulldogs-vanish.md b/.changeset/good-bulldogs-vanish.md new file mode 100644 index 00000000..d20c3add --- /dev/null +++ b/.changeset/good-bulldogs-vanish.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/common-utils": patch +--- + +feat: Set enable_full_text_index=1 when available diff --git a/packages/common-utils/src/clickhouse/index.ts b/packages/common-utils/src/clickhouse/index.ts index 9e30f6f2..32e4e401 100644 --- a/packages/common-utils/src/clickhouse/index.ts +++ b/packages/common-utils/src/clickhouse/index.ts @@ -555,6 +555,9 @@ export abstract class BaseClickhouseClient { // If value is 0, then skip indicies only used on AND queries applySettingIfAvailable('use_skip_indexes_for_disjunctions', '1'); + // Enables full-text (inverted index) search. + applySettingIfAvailable('enable_full_text_index', '1'); + return { ...defaultSettings, ...clickhouse_settings, @@ -814,6 +817,7 @@ export function chSqlToAliasMap( const { sqlWithReplacements, replacements: jsonReplacementsToExpressions } = replaceJsonExpressions(sqlWithoutSettingsClause); const parser = new SQLParser.Parser(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- astify returns union type const ast = parser.astify(sqlWithReplacements, { database: 'Postgresql',