1CREATE TABLE memos (
2  id integer,
3  content text
4);
5INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.');
6INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.');
7INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Groonga.');
8CREATE INDEX grnindex ON memos
9 USING pgroonga (content)
10  WITH (normalizers = '');
11SET enable_seqscan = off;
12SET enable_indexscan = on;
13SET enable_bitmapscan = off;
14SELECT id, content
15  FROM memos
16 WHERE content %% 'postgresql';
17 id | content
18----+---------
19(0 rows)
20
21SELECT id, content
22  FROM memos
23 WHERE content %% 'PostgreSQL';
24 id |                        content
25----+-------------------------------------------------------
26  1 | PostgreSQL is a RDBMS.
27  3 | PGroonga is a PostgreSQL extension that uses Groonga.
28(2 rows)
29
30DROP TABLE memos;
31