> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# text_index_* 会话设置

> ClickHouse 在 text_index_* 自动生成组中的会话设置。

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置可在 [system.settings](/docs/zh/reference/system-tables/settings) 中查看，并根据 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="text_index_hint_max_selectivity">
  ## text\_index\_hint\_max\_selectivity
</div>

<SettingsInfoBlock type="Float" default_value="0.2" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.12"},{"label": "0.2"},{"label": "新设置"}]}]} />

使用基于倒排文本索引构建的 hint 时，过滤器允许的最大选择性。

<div id="text_index_lazy_intersection_density_threshold">
  ## text\_index\_lazy\_intersection\_density\_threshold
</div>

**别名**: `text_index_density_threshold`

<SettingsInfoBlock type="Float" default_value="0.2" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "0.2"},{"label": "由 `text_index_density_threshold` 重命名而来（保留为别名）；用于在惰性倒排列表应用模式下选择倒排列表交集算法。"}]}]} />

在惰性倒排列表应用模式 (`text_index_posting_list_apply_mode = 'lazy'`) 下，用于选择交集算法的倒排列表密度阈值。
低于该阈值：leapfrog 交集 (更适合稀疏倒排列表) 。等于或高于该阈值：穷举 bitmap 交集 (更适合稠密倒排列表) 。

<div id="text_index_like_max_postings_to_read">
  ## text\_index\_like\_max\_postings\_to\_read
</div>

<SettingsInfoBlock type="UInt64" default_value="50" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "50"},{"label": "新增设置"}]}]} />

启用通过字典扫描进行文本索引 LIKE 评估时，可读取的大型 postings 的最大数量。

要求启用 `use_text_index_like_evaluation_by_dictionary_scan`。

<div id="text_index_like_min_pattern_length">
  ## text\_index\_like\_min\_pattern\_length
</div>

<SettingsInfoBlock type="UInt64" default_value="4" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "4"},{"label": "新增设置"}]}]} />

在 LIKE/ILIKE 模式中，要使用通过字典扫描进行的文本索引 LIKE 评估，字母数字 `needle` 需要达到的最小长度。
短于此阈值的模式会匹配过多字典标记，因此会被跳过，以避免代价高昂的扫描。

要求启用 `use_text_index_like_evaluation_by_dictionary_scan`。

<div id="text_index_posting_list_apply_mode">
  ## text\_index\_posting\_list\_apply\_mode
</div>

<SettingsInfoBlock type="TextIndexPostingListApplyMode" default_value="materialize" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "materialize"},{"label": "惰性倒排列表应用模式的新增设置"}]}]} />

控制在文本索引查询期间如何应用倒排列表。
'materialize' (默认) 会立即将倒排列表解码为 Roaring Bitmaps。
'lazy' 使用基于游标的按需解码 (要求索引格式使用序列化 codec) 。
