From b350d2b0a9bccc8534b77b3338a12c4efb0317d6 Mon Sep 17 00:00:00 2001 From: zzzxl Date: Thu, 9 Jan 2025 10:26:36 +0800 Subject: [PATCH] Update the description of the usage of match_phrase_prefix. (#1726) --- docs/table-design/index/inverted-index.md | 1 + .../current/table-design/index/inverted-index.md | 1 + .../version-2.0/table-design/index/inverted-index.md | 1 + .../version-2.1/table-design/index/inverted-index.md | 1 + .../version-3.0/table-design/index/inverted-index.md | 1 + versioned_docs/version-2.0/table-design/index/inverted-index.md | 1 + versioned_docs/version-2.1/table-design/index/inverted-index.md | 1 + versioned_docs/version-3.0/table-design/index/inverted-index.md | 1 + 8 files changed, 8 insertions(+) diff --git a/docs/table-design/index/inverted-index.md b/docs/table-design/index/inverted-index.md index 4b5adfa771c98..c0213223f3ea4 100644 --- a/docs/table-design/index/inverted-index.md +++ b/docs/table-design/index/inverted-index.md @@ -302,6 +302,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 Prefix matching the last word keyword2, with a default limit of 50 prefixes (controlled by session variable inverted_index_max_expansions) +-- It is necessary to ensure that keyword1 and keyword2 remain adjacent in the original text after tokenization, with no other words in between. -- 'keyword1 keyword2abc' matches because keyword1 is identical and keyword2abc is a prefix of keyword2 -- 'keyword1 keyword2' also matches because keyword2 is a prefix of keyword2 -- 'keyword1 keyword3' does not match because keyword3 is not a prefix of keyword2 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/table-design/index/inverted-index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/table-design/index/inverted-index.md index 98dc525b9835d..78b3da13cebb3 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/table-design/index/inverted-index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/table-design/index/inverted-index.md @@ -305,6 +305,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 在保持词顺序的前提下,对最后一个词 keyword2 做前缀匹配,默认找 50 个前缀词(session 变量 inverted_index_max_expansions 控制) +-- 需要保证 keyword1, keyword2 在原文分词后也是相邻的,不能中间有其他词 -- 'keyword1 keyword2abc' 能匹配,因为 keyword1 完全一样,最后一个 keyword2abc 是 keyword2 的前缀 -- 'keyword1 keyword2' 也能匹配,因为 keyword2 也是 keyword2 的前缀 -- 'keyword1 keyword3' 不能匹配,因为 keyword3 不是 keyword2 的前缀 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/table-design/index/inverted-index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/table-design/index/inverted-index.md index 00074fa14b393..4f1d1b8d25c44 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/table-design/index/inverted-index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/table-design/index/inverted-index.md @@ -305,6 +305,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 在保持词顺序的前提下,对最后一个词 keyword2 做前缀匹配,默认找 50 个前缀词(session 变量 inverted_index_max_expansions 控制) +-- 需要保证 keyword1, keyword2 在原文分词后也是相邻的,不能中间有其他词 -- 'keyword1 keyword2abc' 能匹配,因为 keyword1 完全一样,最后一个 keyword2abc 是 keyword2 的前缀 -- 'keyword1 keyword2' 也能匹配,因为 keyword2 也是 keyword2 的前缀 -- 'keyword1 keyword3' 不能匹配,因为 keyword3 不是 keyword2 的前缀 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/table-design/index/inverted-index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/table-design/index/inverted-index.md index 43e12d40b58c9..6666a347a353f 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/table-design/index/inverted-index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/table-design/index/inverted-index.md @@ -305,6 +305,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 在保持词顺序的前提下,对最后一个词 keyword2 做前缀匹配,默认找 50 个前缀词(session 变量 inverted_index_max_expansions 控制) +-- 需要保证 keyword1, keyword2 在原文分词后也是相邻的,不能中间有其他词 -- 'keyword1 keyword2abc' 能匹配,因为 keyword1 完全一样,最后一个 keyword2abc 是 keyword2 的前缀 -- 'keyword1 keyword2' 也能匹配,因为 keyword2 也是 keyword2 的前缀 -- 'keyword1 keyword3' 不能匹配,因为 keyword3 不是 keyword2 的前缀 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/table-design/index/inverted-index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/table-design/index/inverted-index.md index 98dc525b9835d..78b3da13cebb3 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/table-design/index/inverted-index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/table-design/index/inverted-index.md @@ -305,6 +305,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 在保持词顺序的前提下,对最后一个词 keyword2 做前缀匹配,默认找 50 个前缀词(session 变量 inverted_index_max_expansions 控制) +-- 需要保证 keyword1, keyword2 在原文分词后也是相邻的,不能中间有其他词 -- 'keyword1 keyword2abc' 能匹配,因为 keyword1 完全一样,最后一个 keyword2abc 是 keyword2 的前缀 -- 'keyword1 keyword2' 也能匹配,因为 keyword2 也是 keyword2 的前缀 -- 'keyword1 keyword3' 不能匹配,因为 keyword3 不是 keyword2 的前缀 diff --git a/versioned_docs/version-2.0/table-design/index/inverted-index.md b/versioned_docs/version-2.0/table-design/index/inverted-index.md index 11fe799e9e83a..2411fcb137de1 100644 --- a/versioned_docs/version-2.0/table-design/index/inverted-index.md +++ b/versioned_docs/version-2.0/table-design/index/inverted-index.md @@ -302,6 +302,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 Prefix matching the last word keyword2, with a default limit of 50 prefixes (controlled by session variable inverted_index_max_expansions) +-- It is necessary to ensure that keyword1 and keyword2 remain adjacent in the original text after tokenization, with no other words in between. -- 'keyword1 keyword2abc' matches because keyword1 is identical and keyword2abc is a prefix of keyword2 -- 'keyword1 keyword2' also matches because keyword2 is a prefix of keyword2 -- 'keyword1 keyword3' does not match because keyword3 is not a prefix of keyword2 diff --git a/versioned_docs/version-2.1/table-design/index/inverted-index.md b/versioned_docs/version-2.1/table-design/index/inverted-index.md index fae75d681108b..7e86a2bd50df5 100644 --- a/versioned_docs/version-2.1/table-design/index/inverted-index.md +++ b/versioned_docs/version-2.1/table-design/index/inverted-index.md @@ -299,6 +299,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 Prefix matching the last word keyword2, with a default limit of 50 prefixes (controlled by session variable inverted_index_max_expansions) +-- It is necessary to ensure that keyword1 and keyword2 remain adjacent in the original text after tokenization, with no other words in between. -- 'keyword1 keyword2abc' matches because keyword1 is identical and keyword2abc is a prefix of keyword2 -- 'keyword1 keyword2' also matches because keyword2 is a prefix of keyword2 -- 'keyword1 keyword3' does not match because keyword3 is not a prefix of keyword2 diff --git a/versioned_docs/version-3.0/table-design/index/inverted-index.md b/versioned_docs/version-3.0/table-design/index/inverted-index.md index 4b5adfa771c98..c0213223f3ea4 100644 --- a/versioned_docs/version-3.0/table-design/index/inverted-index.md +++ b/versioned_docs/version-3.0/table-design/index/inverted-index.md @@ -302,6 +302,7 @@ SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3'; SELECT * FROM table_name WHERE content MATCH_PHRASE 'keyword1 keyword2 ~3+'; -- 2.3 Prefix matching the last word keyword2, with a default limit of 50 prefixes (controlled by session variable inverted_index_max_expansions) +-- It is necessary to ensure that keyword1 and keyword2 remain adjacent in the original text after tokenization, with no other words in between. -- 'keyword1 keyword2abc' matches because keyword1 is identical and keyword2abc is a prefix of keyword2 -- 'keyword1 keyword2' also matches because keyword2 is a prefix of keyword2 -- 'keyword1 keyword3' does not match because keyword3 is not a prefix of keyword2