[Groonga-commit] pgroonga/pgroonga at 028b7ee [master] test: add a test for query_expand with primary key

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jul 19 09:38:44 JST 2017


Kouhei Sutou	2017-07-19 09:38:44 +0900 (Wed, 19 Jul 2017)

  New Revision: 028b7ee096c31eb7aef2bf2e0af8e27001c18aca
  https://github.com/pgroonga/pgroonga/commit/028b7ee096c31eb7aef2bf2e0af8e27001c18aca

  Message:
    test: add a test for query_expand with primary key

  Added files:
    expected/function/query-expand/normalize-with-primary-key.out
    sql/function/query-expand/normalize-with-primary-key.sql

  Added: expected/function/query-expand/normalize-with-primary-key.out (+15 -0) 100644
===================================================================
--- /dev/null
+++ expected/function/query-expand/normalize-with-primary-key.out    2017-07-19 09:38:44 +0900 (682c383)
@@ -0,0 +1,15 @@
+CREATE TABLE synonyms (
+  term text PRIMARY KEY,
+  synonyms text[]
+);
+CREATE INDEX synonyms_term_index ON synonyms
+  USING pgroonga (term pgroonga.text_term_search_ops_v2);
+INSERT INTO synonyms VALUES ('Groonga', ARRAY['Groonga', 'Senna']);
+INSERT INTO synonyms VALUES ('GROONGA', ARRAY['"Full text search"']);
+SELECT pgroonga.query_expand('synonyms', 'term', 'synonyms', 'groonga');
+                  query_expand                  
+------------------------------------------------
+ ((Groonga) OR (Senna) OR ("Full text search"))
+(1 row)
+
+DROP TABLE synonyms;

  Added: sql/function/query-expand/normalize-with-primary-key.sql (+14 -0) 100644
===================================================================
--- /dev/null
+++ sql/function/query-expand/normalize-with-primary-key.sql    2017-07-19 09:38:44 +0900 (21a8ba3)
@@ -0,0 +1,14 @@
+CREATE TABLE synonyms (
+  term text PRIMARY KEY,
+  synonyms text[]
+);
+
+CREATE INDEX synonyms_term_index ON synonyms
+  USING pgroonga (term pgroonga.text_term_search_ops_v2);
+
+INSERT INTO synonyms VALUES ('Groonga', ARRAY['Groonga', 'Senna']);
+INSERT INTO synonyms VALUES ('GROONGA', ARRAY['"Full text search"']);
+
+SELECT pgroonga.query_expand('synonyms', 'term', 'synonyms', 'groonga');
+
+DROP TABLE synonyms;
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index