You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/engines/table-engines/mergetree-family/invertedindexes.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ CREATE TABLE tab
54
54
(
55
55
`key` UInt64,
56
56
`str` String,
57
-
INDEX inv_idx(str) TYPE full_text(0) GRANULARITY 1
57
+
INDEX inv_idx(str) TYPE gin(0) GRANULARITY 1
58
58
)
59
59
ENGINE = MergeTree
60
60
ORDER BY key
@@ -66,20 +66,20 @@ In earlier versions of ClickHouse, the corresponding index type name was `invert
66
66
67
67
where `N` specifies the tokenizer:
68
68
69
-
-`full_text(0)` (or shorter: `full_text()`) set the tokenizer to "tokens", i.e. split strings along spaces,
70
-
-`full_text(N)` with `N` between 2 and 8 sets the tokenizer to "ngrams(N)"
69
+
-`gin(0)` (or shorter: `gin()`) set the tokenizer to "tokens", i.e. split strings along spaces,
70
+
-`gin(N)` with `N` between 2 and 8 sets the tokenizer to "ngrams(N)"
71
71
72
72
The maximum rows per postings list can be specified as the second parameter. This parameter can be used to control postings list sizes to avoid generating huge postings list files. The following variants exist:
73
73
74
-
-`full_text(ngrams, max_rows_per_postings_list)`: Use given max_rows_per_postings_list (assuming it is not 0)
75
-
-`full_text(ngrams, 0)`: No limitation of maximum rows per postings list
76
-
-`full_text(ngrams)`: Use a default maximum rows which is 64K.
74
+
-`gin(ngrams, max_rows_per_postings_list)`: Use given max_rows_per_postings_list (assuming it is not 0)
75
+
-`gin(ngrams, 0)`: No limitation of maximum rows per postings list
76
+
-`gin(ngrams)`: Use a default maximum rows which is 64K.
77
77
78
78
Being a type of skipping index, full-text indexes can be dropped or added to a column after table creation:
79
79
80
80
```sql
81
81
ALTERTABLE tab DROP INDEX inv_idx;
82
-
ALTERTABLE tab ADD INDEX inv_idx(s) TYPE full_text(2);
82
+
ALTERTABLE tab ADD INDEX inv_idx(s) TYPE gin(2);
83
83
```
84
84
85
85
To use the index, no special functions or syntax are required. Typical string search predicates automatically leverage the index. As
@@ -177,7 +177,7 @@ We will use `ALTER TABLE` and add an full-text index on the lowercase of the `co
177
177
178
178
```sql
179
179
ALTERTABLE hackernews
180
-
ADD INDEX comment_lowercase(lower(comment)) TYPE full_text;
180
+
ADD INDEX comment_lowercase(lower(comment)) TYPE gin;
181
181
182
182
ALTERTABLE hackernews MATERIALIZE INDEX comment_lowercase;
throwException(ErrorCodes::ILLEGAL_INDEX, "Duplicated index name {} is not allowed. Please use a different index name", backQuoteIfNeed(index_desc.name));
if (index_desc.type == FULL_TEXT_INDEX_NAME && !settings[Setting::allow_experimental_full_text_index])
796
+
if (index_desc.type == GIN_INDEX_NAME && !settings[Setting::allow_experimental_full_text_index])
797
797
throwException(ErrorCodes::SUPPORT_IS_DISABLED, "The experimental full-text index feature is disabled. Enable the setting 'allow_experimental_full_text_index' to use it");
798
-
/// ----
799
-
/// Temporary check during a transition period. Please remove at the end of 2024.
798
+
/// ---
799
+
/// Temporary checks during a transition period. Remove this block one year after GIN indexes became GA.
800
+
if (index_desc.type == FULL_TEXT_INDEX_NAME && !settings[Setting::allow_experimental_full_text_index])
801
+
throwException(ErrorCodes::ILLEGAL_INDEX, "The 'full_text' index type is deprecated. Please use the 'gin' index type instead");
800
802
if (index_desc.type == INVERTED_INDEX_NAME && !settings[Setting::allow_experimental_inverted_index])
801
-
throwException(ErrorCodes::ILLEGAL_INDEX, "The 'inverted' index type is deprecated. Please use the 'full_text' index type instead");
802
-
/// ----
803
+
throwException(ErrorCodes::ILLEGAL_INDEX, "The 'inverted' index type is deprecated. Please use the 'gin' index type instead");
804
+
/// ---
803
805
if (index_desc.type == "vector_similarity" && !settings[Setting::allow_experimental_vector_similarity_index])
804
806
throwException(ErrorCodes::SUPPORT_IS_DISABLED, "The experimental vector similarity index feature is disabled. Enable the setting 'allow_experimental_vector_similarity_index' to use it");
0 commit comments