Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
310 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (plugins = 'query_expanders/tsv'); | ||
| SELECT pgroonga.command('object_exist QueryExpanderTSV')::json->>1; | ||
| ?column? | ||
| ---------- | ||
| true | ||
| (1 row) | ||
|
|
||
| DROP TABLE memos; |
45 changes: 45 additions & 0 deletions
45
expected/full-text-search/text/options/token-filters/custom.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (plugins = 'token_filters/stem', | ||
| token_filters = 'TokenFilterStem'); | ||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
| id | content | ||
| ----+----------- | ||
| 1 | It works. | ||
| 2 | I work. | ||
| 3 | I worked. | ||
| (3 rows) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
| id | content | ||
| ----+----------- | ||
| 1 | It works. | ||
| 2 | I work. | ||
| 3 | I worked. | ||
| (3 rows) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
| id | content | ||
| ----+----------- | ||
| 1 | It works. | ||
| 2 | I work. | ||
| 3 | I worked. | ||
| (3 rows) | ||
|
|
||
| DROP TABLE memos; |
38 changes: 38 additions & 0 deletions
38
expected/full-text-search/text/options/token-filters/empty.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (token_filters = ''); | ||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
| id | content | ||
| ----+----------- | ||
| 1 | It works. | ||
| (1 row) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
| id | content | ||
| ----+--------- | ||
| 2 | I work. | ||
| (1 row) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
| id | content | ||
| ----+----------- | ||
| 3 | I worked. | ||
| (1 row) | ||
|
|
||
| DROP TABLE memos; |
38 changes: 38 additions & 0 deletions
38
expected/full-text-search/text/options/token-filters/none.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (token_filters = 'none'); | ||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
| id | content | ||
| ----+----------- | ||
| 1 | It works. | ||
| (1 row) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
| id | content | ||
| ----+--------- | ||
| 2 | I work. | ||
| (1 row) | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
| id | content | ||
| ----+----------- | ||
| 3 | I worked. | ||
| (1 row) | ||
|
|
||
| DROP TABLE memos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
|
|
||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (plugins = 'query_expanders/tsv'); | ||
|
|
||
| SELECT pgroonga.command('object_exist QueryExpanderTSV')::json->>1; | ||
|
|
||
| DROP TABLE memos; |
31 changes: 31 additions & 0 deletions
31
sql/full-text-search/text/options/token-filters/custom.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
|
|
||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
|
|
||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (plugins = 'token_filters/stem', | ||
| token_filters = 'TokenFilterStem'); | ||
|
|
||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
|
|
||
| DROP TABLE memos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
|
|
||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
|
|
||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (token_filters = ''); | ||
|
|
||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
|
|
||
| DROP TABLE memos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
|
|
||
| INSERT INTO memos VALUES (1, 'It works.'); | ||
| INSERT INTO memos VALUES (2, 'I work.'); | ||
| INSERT INTO memos VALUES (3, 'I worked.'); | ||
|
|
||
| CREATE INDEX pgrn_index ON memos | ||
| USING pgroonga (content) | ||
| WITH (token_filters = 'none'); | ||
|
|
||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = off; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'works'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'work'; | ||
|
|
||
| SELECT id, content | ||
| FROM memos | ||
| WHERE content %% 'worked'; | ||
|
|
||
| DROP TABLE memos; |
Oops, something went wrong.