> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# text_index_* 会话设置

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

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["版本", "默认值", "注释"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        版本历史
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

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](/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" />

使用基于倒排文本索引构建的 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" />

在惰性倒排列表应用模式 (`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" />

启用通过字典扫描进行文本索引 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" />

在 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" />

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