Kouhei Sutou
null+****@clear*****
Wed Jun 7 15:42:41 JST 2017
Kouhei Sutou 2017-06-07 15:42:41 +0900 (Wed, 07 Jun 2017) New Revision: cc739ea435516ef5dd00dc4337f0c308d663efbc https://github.com/pgroonga/pgroonga.github.io/commit/cc739ea435516ef5dd00dc4337f0c308d663efbc Message: prefix-rk-search-in-v2: add more information Modified files: reference/index.md reference/operators/prefix-rk-search-contain-v2.md reference/operators/prefix-rk-search-v2.md reference/operators/prefix-search-contain-v2.md reference/operators/prefix-search-in-v2.md reference/operators/prefix-search-v2.md reference/operators/query-in-v2.md Modified: reference/index.md (+9 -9) =================================================================== --- reference/index.md 2017-06-07 15:16:22 +0900 (6f148f3) +++ reference/index.md 2017-06-07 15:42:41 +0900 (5d1fe7c) @@ -202,13 +202,13 @@ If you use them, you need to use [incompatible case steps][upgrade-incompatible] * [`&^>` operator][prefix-search-in-v2]: Prefix search by an array of prefixes - * Deprecated since 1.2.1. Use [`&^|` operator][query-in-v2] instead. + * Deprecated since 1.2.1. Use [`&^|` operator][prefix-search-in-v2] instead. * [`&^~|` operator][prefix-rk-search-in-v2]: Prefix RK search by an array of prefixes * [`&^~>` operator][prefix-rk-search-in-v2]: Prefix RK search by an array of prefixes - * Deprecated since 1.2.1. Use [`&^~|` operator][query-in-v2] instead. + * Deprecated since 1.2.1. Use [`&^~|` operator][prefix-rk-search-in-v2] instead. #### `pgroonga.text_regexp_ops_v2` operator class {#text-regexp-ops-v2} @@ -258,19 +258,19 @@ If you use them, you need to use [incompatible case steps][upgrade-incompatible] * [`&^` operator][prefix-search-v2]: Prefix search - * [`&^~` operator][prefix-rk-search-v2]: Prefix RK search + * [`&^>` operator][prefix-search-v2]: Prefix search - * [`&^|` operator][prefix-search-in-v2]: Prefix search by an array of prefixes + * Deprecated since 1.2.1. Use [`&^` operator][prefix-search-v2] instead. - * [`&^>` operator][prefix-search-in-v2]: Prefix search by an array of prefixes + * [`&^~` operator][prefix-rk-search-v2]: Prefix RK search - * Deprecated since 1.2.1. Use [`&^|` operator][query-in-v2] instead. + * [`&^~>` operator][prefix-rk-search-v2]: Prefix RK search - * [`&^~|` operator][prefix-rk-search-in-v2]: Prefix RK search by an array of prefixes + * Deprecated since 1.2.1. Use [`&^~` operator][prefix-rk-search-v2] instead. - * [`&^~>` operator][prefix-rk-search-in-v2]: Prefix RK search by an array of prefixes + * [`&^|` operator][prefix-search-in-v2]: Prefix search by an array of prefixes - * Deprecated since 1.2.1. Use [`&^~|` operator][query-in-v2] instead. + * [`&^~|` operator][prefix-rk-search-in-v2]: Prefix RK search by an array of prefixes ### For `varchar` Modified: reference/operators/prefix-rk-search-contain-v2.md (+1 -1) =================================================================== --- reference/operators/prefix-rk-search-contain-v2.md 2017-06-07 15:16:22 +0900 (b43b742) +++ reference/operators/prefix-rk-search-contain-v2.md 2017-06-07 15:42:41 +0900 (0a76313) @@ -1,5 +1,5 @@ --- title: "&^~> operator" upper_level: ../ -redirect: prefix-rk-search-in-v2.html +redirect: prefix-rk-search-v2.html --- Modified: reference/operators/prefix-rk-search-v2.md (+3 -1) =================================================================== --- reference/operators/prefix-rk-search-v2.md 2017-06-07 15:16:22 +0900 (5da3535) +++ reference/operators/prefix-rk-search-v2.md 2017-06-07 15:42:41 +0900 (887e7b7) @@ -5,10 +5,12 @@ upper_level: ../ # `&^~` operator -Since 2.0.0. +Since 1.2.1. ## Summary +`&^~>` operator for `text[]` is deprecated since 1.2.1. Use `&^~` operator instead. + `&^~` operator performs [prefix RK search][groonga-prefik-rk-search]. R is for [Romaji][wikipedia-romaji]. K is for [Kana][wikipedia-kana]. Prefix RK search is useful for Japanese. Modified: reference/operators/prefix-search-contain-v2.md (+1 -1) =================================================================== --- reference/operators/prefix-search-contain-v2.md 2017-06-07 15:16:22 +0900 (ca57161) +++ reference/operators/prefix-search-contain-v2.md 2017-06-07 15:42:41 +0900 (377e1cf) @@ -1,5 +1,5 @@ --- title: "&^> operator" upper_level: ../ -redirect: prefix-search-in-v2.html +redirect: prefix-search-v2.html --- Modified: reference/operators/prefix-search-in-v2.md (+40 -26) =================================================================== --- reference/operators/prefix-search-in-v2.md 2017-06-07 15:16:22 +0900 (33ceeb3) +++ reference/operators/prefix-search-in-v2.md 2017-06-07 15:42:41 +0900 (1c9e01f) @@ -1,31 +1,37 @@ --- -title: "&^> operator" +title: "&^| operator" upper_level: ../ --- -# `&^>` operator +# `&^|` operator -Since 1.0.9. +Since 1.2.1. ## Summary -This operator uses v2 operator class. It doesn't provide backward compatibility until PGroonga 2.0.0. Use it carefully. - -`&^>` operator performs prefix search. +`&^|` operator performs prefix search by an array of prefixes. If one or more prefixes are matched, the record is matched. Prefix search is useful for implementing input completion. ## Syntax ```sql -column &^> prefix +column &^| prefixes ``` -`column` is a column to be searched. It's `text[]` type. +`column` is a column to be searched. It's `text` type or `text[]` type. + +`prefixes` is an array of prefixes to be found. It's `text[]` type. + +The operator returns `true` when the `column` value starts with one or more prefixes in `prefixes`. + +## Operator classes -`prefix` is a prefix to be found. It's `text` type. +You need to specify one of the following operator classes to use this operator: -The operator returns `true` when one of the `column` values start with `prefix`. + * `pgroonga.text_term_search_ops`: For `text`. + + * `pgroonga.text_array_term_search_ops`: For `text[]`. ## Usage @@ -34,34 +40,42 @@ Here are sample schema and data for examples: ```sql CREATE TABLE tags ( name text PRIMARY KEY, - aliases text[] + alias text ); -CREATE INDEX pgroonga_tag_aliases_index ON tags - USING pgroonga (aliases pgroonga.text_array_term_search_ops_v2); +CREATE INDEX pgroonga_tag_alias_index ON tags + USING pgroonga (alias pgroonga.text_term_search_ops_v2); ``` ```sql -INSERT INTO tags VALUES ('PostgreSQL', ARRAY['PostgreSQL', 'PG']); -INSERT INTO tags VALUES ('Groonga', ARRAY['Groonga', 'grn']); -INSERT INTO tags VALUES ('PGroonga', ARRAY['PGroonga', 'pgrn']); +INSERT INTO tags VALUES ('PostgreSQL', 'PG'); +INSERT INTO tags VALUES ('Groonga', 'grn'); +INSERT INTO tags VALUES ('PGroonga', 'pgrn'); +INSERT INTO tags VALUES ('Mroonga', 'mrn'); ``` -You can perform prefix search with prefix by `&^>` operator: +You can perform prefix search with prefixes by `&^|` operator: ```sql -SELECT * FROM tags WHERE aliases &^> 'pg'; --- name | aliases --- ------------+----------------- --- PostgreSQL | {PostgreSQL,PG} --- PGroonga | {PGroonga,pgrn} --- (2 rows) +SELECT * FROM tags WHERE alias &^| ARRAY['pg', 'mrn']; +-- name | alias +-- ------------+------- +-- PostgreSQL | PG +-- PGroonga | pgrn +-- Mroonga | mrn +-- (3 rows) ``` ## See also - * [`&^` operator](prefix-search-v2.html) + * [`&^` operator][prefix-search-v2] + + * [`&^~` operator][prefix-rk-search-v2] + + * [`&^~|` operator][prefix-rk-search-in-v2] + +[prefix-search-v2]:prefix-search-v2.html - * [`&^~` operator](prefix-rk-search-v2.html) +[prefix-rk-search-v2]:prefix-rk-search-v2.html - * [`&^~>` operator](prefix-rk-search-contain-v2.html) +[prefix-rk-search-in-v2]:prefix-rk-search-in-v2.html Modified: reference/operators/prefix-search-v2.md (+3 -1) =================================================================== --- reference/operators/prefix-search-v2.md 2017-06-07 15:16:22 +0900 (497fb1d) +++ reference/operators/prefix-search-v2.md 2017-06-07 15:42:41 +0900 (869a8e1) @@ -5,10 +5,12 @@ upper_level: ../ # `&^` operator -Since 2.0.0. +Since 1.2.1. ## Summary +`&^>` operator for `text[]` is deprecated since 1.2.1. Use `&^` operator instead. + `&^` operator performs prefix search. Prefix search is useful for implementing input completion. Modified: reference/operators/query-in-v2.md (+2 -2) =================================================================== --- reference/operators/query-in-v2.md 2017-06-07 15:16:22 +0900 (cc3e85d) +++ reference/operators/query-in-v2.md 2017-06-07 15:42:41 +0900 (38457c8) @@ -11,7 +11,7 @@ Since 2.0.0. `&?>` operator is deprecated since 1.2.1. Use `&?|` operator instead. -`&?|` operator performs full text search by array of queries. If one or more queries are matched, the record is matched. +`&?|` operator performs full text search by an array of queries. If one or more queries are matched, the record is matched. Query's syntax is similar to syntax that is used in Web search engine. For example, you can use OR search by `KEYWORD1 OR KEYWORD2` in query. @@ -27,7 +27,7 @@ column &?| queries [Groonga's query syntax][groonga-query-syntax] is used in `query`. -The operator returns `true` when one or more query in `queries` are matched against `column`. +The operator returns `true` when one or more queries in `queries` are matched against `column`. ## Operator classes -------------- next part -------------- HTML����������������������������... Download