This is a document for PGroonga 2.0.0 or later. See PGroonga 1.X document when you're using PGroonga 1.X.
!&^| operatorSince 2.2.1.
!&^| operator performs NOT prefix search by an array of prefixes. If one or more prefixes are matched, the record is NOT matched.
column !&^| prefixes
column is a column to be searched. It's text type.
prefixes is an array of prefixes to be found. It's text[] type.
The operator returns true when the column value doesn't start with any prefixes in prefixes.
You need to specify one of the following operator classes to use this operator:
pgroonga_text_term_search_ops_v2: For textHere are sample schema and data for examples:
CREATE TABLE tags (
name text PRIMARY KEY,
alias text
);
CREATE INDEX pgroonga_tag_alias_index ON tags
USING pgroonga (alias pgroonga_text_term_search_ops_v2);
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 NOT prefix search with prefixes by !&^| operator:
SELECT * FROM tags WHERE alias !&^| ARRAY['pg', 'mrn'];
-- name | alias
-- ------------+-------
-- Groonga | grn
-- (1 row)
&^ operator: Prefix search
&^~ operator: Prefix RK search
&^| operator: Prefix search by an array of prefixes
&^~| operator: Prefix RK search by an array of prefixes