[Groonga-commit] groonga/groonga at a04ab13 [master] test: add load/index/offline/vector_test

Back to archive index

Susumu Yata null+****@clear*****
Sat Jul 1 23:17:16 JST 2017


Susumu Yata	2017-07-01 23:17:16 +0900 (Sat, 01 Jul 2017)

  New Revision: a04ab1334546d1a1b61de461494b681f1209f4a3
  https://github.com/groonga/groonga/commit/a04ab1334546d1a1b61de461494b681f1209f4a3

  Message:
    test: add load/index/offline/vector_test
    
    GitHub: #494

  Added files:
    test/command/suite/load/index/offline/vector_text.expected
    test/command/suite/load/index/offline/vector_text.test

  Added: test/command/suite/load/index/offline/vector_text.expected (+87 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/load/index/offline/vector_text.expected    2017-07-01 23:17:16 +0900 (1d9f3a5)
@@ -0,0 +1,87 @@
+table_create Docs TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Docs sentences COLUMN_VECTOR Text
+[[0,0.0,0.0],true]
+load --table Docs
+[
+{"sentences":["午前中は良く晴れます.", "午後は雨が降ります."]}
+]
+[[0,0.0,0.0],1]
+table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Words docs_sentences COLUMN_INDEX|WITH_POSITION|WITH_SECTION Docs sentences
+[[0,0.0,0.0],true]
+select Docs --match_columns 'sentences' --query '"午前中"'   --output_columns '_id,_score,sentences'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_score",
+          "Int32"
+        ],
+        [
+          "sentences",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        1,
+        [
+          "午前中は良く晴れます.",
+          "午後は雨が降ります."
+        ]
+      ]
+    ]
+  ]
+]
+select Docs --match_columns 'sentences' --query '"ります"'   --output_columns '_id,_score,sentences'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_score",
+          "Int32"
+        ],
+        [
+          "sentences",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        1,
+        [
+          "午前中は良く晴れます.",
+          "午後は雨が降ります."
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/load/index/offline/vector_text.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/load/index/offline/vector_text.test    2017-07-01 23:17:16 +0900 (84d9106)
@@ -0,0 +1,16 @@
+table_create Docs TABLE_NO_KEY
+column_create Docs sentences COLUMN_VECTOR Text
+
+load --table Docs
+[
+{"sentences":["午前中は良く晴れます.", "午後は雨が降ります."]}
+]
+
+table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Words docs_sentences COLUMN_INDEX|WITH_POSITION|WITH_SECTION Docs sentences
+
+select Docs --match_columns 'sentences' --query '"午前中"' \
+  --output_columns '_id,_score,sentences'
+
+select Docs --match_columns 'sentences' --query '"ります"' \
+  --output_columns '_id,_score,sentences'
-------------- next part --------------
HTML����������������������������...
下載 



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