Kouhei Sutou
null+****@clear*****
Tue Jun 6 16:07:16 JST 2017
Kouhei Sutou 2017-06-06 16:07:16 +0900 (Tue, 06 Jun 2017) New Revision: 17b1c24cffdbfe653975c7a3077ffcd683c99071 https://github.com/pgroonga/pgroonga.github.io/commit/17b1c24cffdbfe653975c7a3077ffcd683c99071 Message: contain-term-v2: add more information Copied files: reference/operators/contain-term.md (from reference/operators/contain-term-v2.md) Modified files: reference/operators/contain-term-v2.md Modified: reference/operators/contain-term-v2.md (+17 -9) =================================================================== --- reference/operators/contain-term-v2.md 2017-06-06 15:58:59 +0900 (4d086fd) +++ reference/operators/contain-term-v2.md 2017-06-06 16:07:16 +0900 (75d1def) @@ -1,26 +1,34 @@ --- -title: "&@ operator for varchar[]" +title: "&> operator" upper_level: ../ --- -# `&@` operator for `varchar[]` +# `&>` operator -## Summary +Since 1.2.1. -This operator uses v2 operator class. It doesn't provide backward compatibility until PGroonga 2.0.0. Use it carefully. +## Summary -`&@` operator checks whether a term is included in an array of terms. +`&>` operator checks whether a term is included in an array of terms. ## Syntax ```sql -column &@ term +column &> term ``` -`column` is `varchar[]` type column to be searched. +`column` is a column to be searched. It's `varchar[]` type. `term` is a term to be found. It's `varchar` type. +## Operator classes + +You need to specify one of the following operator classes to use this operator: + + * `pgroonga.varchar_array_ops`: Default for `varchar[]`. + + * `pgroonga.varchar_array_term_search_ops`: For `varchar[]`. + ## Usage Here are sample schema and data for examples: @@ -41,10 +49,10 @@ INSERT INTO memos VALUES (3, ARRAY['PGroonga', 'PostgreSQL', 'Groonga']); INSERT INTO memos VALUES (4, ARRAY['Groonga']); ``` -You can find records that contain `'Groonga'` term in an array of terms by `&@` operator: +You can find records that contain `'Groonga'` term in an array of terms by `&>` operator: ```sql -SELECT * FROM memos WHERE tags &@ 'Groonga'; +SELECT * FROM memos WHERE tags &> 'Groonga'; -- id | tags -- ----+------------------------------- -- 2 | {Groonga} Copied: reference/operators/contain-term.md (+22 -8) 53% =================================================================== --- reference/operators/contain-term-v2.md 2017-06-06 15:58:59 +0900 (4d086fd) +++ reference/operators/contain-term.md 2017-06-06 16:07:16 +0900 (82e42e8) @@ -1,26 +1,34 @@ --- -title: "&@ operator for varchar[]" +title: "%% operator for varchar[]" upper_level: ../ --- -# `&@` operator for `varchar[]` +# `&>` operator for `varchar[]` ## Summary -This operator uses v2 operator class. It doesn't provide backward compatibility until PGroonga 2.0.0. Use it carefully. +This operator is deprecated since 1.2.1. Use [`&>` operator][contain-term-v2] instead. -`&@` operator checks whether a term is included in an array of terms. +`%%` operator checks whether a term is included in an array of terms. ## Syntax ```sql -column &@ term +column %% term ``` -`column` is `varchar[]` type column to be searched. +`column` is a column to be searched. It's `varchar[]` type. `term` is a term to be found. It's `varchar` type. +## Operator classes + +You need to specify one of the following operator classes to use this operator: + + * `pgroonga.varchar_array_ops`: Default for `varchar[]`. + + * `pgroonga.varchar_array_term_search_ops`: For `varchar[]`. + ## Usage Here are sample schema and data for examples: @@ -41,10 +49,10 @@ INSERT INTO memos VALUES (3, ARRAY['PGroonga', 'PostgreSQL', 'Groonga']); INSERT INTO memos VALUES (4, ARRAY['Groonga']); ``` -You can find records that contain `'Groonga'` term in an array of terms by `&@` operator: +You can find records that contain `'Groonga'` term in an array of terms by `%%` operator: ```sql -SELECT * FROM memos WHERE tags &@ 'Groonga'; +SELECT * FROM memos WHERE tags %% 'Groonga'; -- id | tags -- ----+------------------------------- -- 2 | {Groonga} @@ -52,3 +60,9 @@ SELECT * FROM memos WHERE tags &@ 'Groonga'; -- 4 | {Groonga} -- (3 rows) ``` + +## See also + + * [`&>` operator][contain-term-v2] + +[contain-term-v2]:contain-term-v2.html -------------- next part -------------- HTML����������������������������... Download