[Groonga-commit] groonga/groonga at 664f85b [master] test: add a test for 'vector @ "element"'

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Dec 8 18:21:41 JST 2014


Kouhei Sutou	2014-12-08 18:21:41 +0900 (Mon, 08 Dec 2014)

  New Revision: 664f85be855f7d9742dc4d4c063b01c753b17f17
  https://github.com/groonga/groonga/commit/664f85be855f7d9742dc4d4c063b01c753b17f17

  Message:
    test: add a test for 'vector @ "element"'

  Added files:
    test/command/suite/select/filter/index/match/vector.expected
    test/command/suite/select/filter/index/match/vector.test

  Added: test/command/suite/select/filter/index/match/vector.expected (+55 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/match/vector.expected    2014-12-08 18:21:41 +0900 (5626d34)
@@ -0,0 +1,55 @@
+table_create Memos TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Memos tags COLUMN_VECTOR ShortText
+[[0,0.0,0.0],true]
+table_create Tags TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Tags memos_index COLUMN_INDEX Memos tags
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"_key": "Groonga is fast", "tags": ["Groonga"]},
+{"_key": "Mroonga is fast", "tags": ["Groonga", "Mroonga", "MySQL"]},
+{"_key": "Rroonga is fast", "tags": ["Groonga", "Rroonga", "Ruby"]},
+{"_key": "Ruby is fan",     "tags": ["Ruby"]}
+]
+[[0,0.0,0.0],4]
+select Memos --output_columns _key,tags --filter 'tags @ "Ruby"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        2
+      ],
+      [
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "tags",
+          "ShortText"
+        ]
+      ],
+      [
+        "Rroonga is fast",
+        [
+          "Groonga",
+          "Rroonga",
+          "Ruby"
+        ]
+      ],
+      [
+        "Ruby is fan",
+        [
+          "Ruby"
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/index/match/vector.test (+15 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/match/vector.test    2014-12-08 18:21:41 +0900 (444a6f4)
@@ -0,0 +1,15 @@
+table_create Memos TABLE_HASH_KEY ShortText
+column_create Memos tags COLUMN_VECTOR ShortText
+
+table_create Tags TABLE_PAT_KEY ShortText
+column_create Tags memos_index COLUMN_INDEX Memos tags
+
+load --table Memos
+[
+{"_key": "Groonga is fast", "tags": ["Groonga"]},
+{"_key": "Mroonga is fast", "tags": ["Groonga", "Mroonga", "MySQL"]},
+{"_key": "Rroonga is fast", "tags": ["Groonga", "Rroonga", "Ruby"]},
+{"_key": "Ruby is fan",     "tags": ["Ruby"]}
+]
+
+select Memos --output_columns _key,tags --filter 'tags @ "Ruby"'
-------------- next part --------------
HTML����������������������������...
Download 



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