Kouhei Sutou
null+****@clear*****
Mon Feb 15 23:43:25 JST 2016
Kouhei Sutou 2016-02-15 23:43:25 +0900 (Mon, 15 Feb 2016) New Revision: 503c7a3963543ba769c056908d7bdbb3a3d371de https://github.com/pgroonga/pgroonga/commit/503c7a3963543ba769c056908d7bdbb3a3d371de Message: test: add a test for LIKE + score() and composite primary key Added files: expected/full-text-search/text/single/score/composite-primary-key/like.out sql/full-text-search/text/single/score/composite-primary-key/like.sql Added: expected/full-text-search/text/single/score/composite-primary-key/like.out (+26 -0) 100644 =================================================================== --- /dev/null +++ expected/full-text-search/text/single/score/composite-primary-key/like.out 2016-02-15 23:43:25 +0900 (955c981) @@ -0,0 +1,26 @@ +CREATE TABLE memos ( + created_date varchar(10), + slug varchar(100), + content text, + PRIMARY KEY (created_date, slug) +); +INSERT INTO memos VALUES + ('2015-11-19', 'postgresql', 'PostgreSQL is a RDBMS.'); +INSERT INTO memos VALUES + ('2015-11-19', 'groonga', 'Groonga is fast full text search engine.'); +INSERT INTO memos VALUES + ('2015-11-19', 'pgroonga', 'PGroonga is a PostgreSQL extension that uses Groonga.'); +CREATE INDEX grnindex ON memos USING pgroonga (created_date, slug, content); +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT created_date, slug, content, pgroonga.score(memos) + FROM memos + WHERE content LIKE '%Groonga%'; + created_date | slug | content | score +--------------+----------+-------------------------------------------------------+------- + 2015-11-19 | groonga | Groonga is fast full text search engine. | 1 + 2015-11-19 | pgroonga | PGroonga is a PostgreSQL extension that uses Groonga. | 1 +(2 rows) + +DROP TABLE memos; Added: sql/full-text-search/text/single/score/composite-primary-key/like.sql (+25 -0) 100644 =================================================================== --- /dev/null +++ sql/full-text-search/text/single/score/composite-primary-key/like.sql 2016-02-15 23:43:25 +0900 (70bbb2e) @@ -0,0 +1,25 @@ +CREATE TABLE memos ( + created_date varchar(10), + slug varchar(100), + content text, + PRIMARY KEY (created_date, slug) +); + +INSERT INTO memos VALUES + ('2015-11-19', 'postgresql', 'PostgreSQL is a RDBMS.'); +INSERT INTO memos VALUES + ('2015-11-19', 'groonga', 'Groonga is fast full text search engine.'); +INSERT INTO memos VALUES + ('2015-11-19', 'pgroonga', 'PGroonga is a PostgreSQL extension that uses Groonga.'); + +CREATE INDEX grnindex ON memos USING pgroonga (created_date, slug, content); + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT created_date, slug, content, pgroonga.score(memos) + FROM memos + WHERE content LIKE '%Groonga%'; + +DROP TABLE memos; -------------- next part -------------- HTML����������������������������...Download