[Groonga-commit] groonga/groonga at f241a3a [master] test: add 4-items tests

Back to archive index

Masafumi Yokoyama null+****@clear*****
Thu Mar 12 14:35:57 JST 2015


Masafumi Yokoyama	2015-03-12 14:35:57 +0900 (Thu, 12 Mar 2015)

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

  Merged 93ea339: Merge pull request #304 from groonga/add-tests-for-select-by-index-of-section

  Message:
    test: add 4-items tests

  Added files:
    test/command/suite/select/match_columns/section/by_index/4_items/no_weight.expected
    test/command/suite/select/match_columns/section/by_index/4_items/no_weight.test
    test/command/suite/select/match_columns/section/by_index/4_items/weight.expected
    test/command/suite/select/match_columns/section/by_index/4_items/weight.test

  Added: test/command/suite/select/match_columns/section/by_index/4_items/no_weight.expected (+58 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/section/by_index/4_items/no_weight.expected    2015-03-12 14:35:57 +0900 (43ac1ac)
@@ -0,0 +1,58 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos comment COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos category COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION   Memos title,content,comment,category
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["title", "content", "comment", "category"],
+["groonga", "Start groonga!", "groonga!", "groonga"],
+["mroonga", "Start mroonga!", "mroonga!", "mroonga"],
+["rroonga", "Start rroonga!", "rroonga!", "rroonga"],
+["Ruby", "Start Ruby!", "Ruby!", "Ruby"],
+["learn", "Learning Ruby and groonga...", "learn!", "learn"]
+]
+[[0,0.0,0.0],5]
+select Memos   --match_columns "Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]"   --query rroonga   --output_columns "title, content, _score"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "title",
+          "ShortText"
+        ],
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "rroonga",
+        "Start rroonga!",
+        4
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/match_columns/section/by_index/4_items/no_weight.test (+24 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/section/by_index/4_items/no_weight.test    2015-03-12 14:35:57 +0900 (da09309)
@@ -0,0 +1,24 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos title COLUMN_SCALAR ShortText
+column_create Memos content COLUMN_SCALAR ShortText
+column_create Memos comment COLUMN_SCALAR ShortText
+column_create Memos category COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION \
+  Memos title,content,comment,category
+
+load --table Memos
+[
+["title", "content", "comment", "category"],
+["groonga", "Start groonga!", "groonga!", "groonga"],
+["mroonga", "Start mroonga!", "mroonga!", "mroonga"],
+["rroonga", "Start rroonga!", "rroonga!", "rroonga"],
+["Ruby", "Start Ruby!", "Ruby!", "Ruby"],
+["learn", "Learning Ruby and groonga...", "learn!", "learn"]
+]
+
+select Memos \
+  --match_columns "Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]" \
+  --query rroonga \
+  --output_columns "title, content, _score"

  Added: test/command/suite/select/match_columns/section/by_index/4_items/weight.expected (+58 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/section/by_index/4_items/weight.expected    2015-03-12 14:35:57 +0900 (44e416e)
@@ -0,0 +1,58 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos comment COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Memos category COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION   Memos title,content,comment,category
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["title", "content", "comment", "category"],
+["groonga", "Start groonga!", "groonga!", "groonga"],
+["mroonga", "Start mroonga!", "mroonga!", "mroonga"],
+["rroonga", "Start rroonga!", "rroonga!", "rroonga"],
+["Ruby", "Start Ruby!", "Ruby!", "Ruby"],
+["learn", "Learning Ruby and groonga...", "learn!", "learn"]
+]
+[[0,0.0,0.0],5]
+select Memos   --match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] * 3 || Lexicon.memo_index[2] * 2 || Lexicon.memo_index[3] * 7"   --query rroonga   --output_columns "title, content, _score"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "title",
+          "ShortText"
+        ],
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "rroonga",
+        "Start rroonga!",
+        22
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/match_columns/section/by_index/4_items/weight.test (+24 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/section/by_index/4_items/weight.test    2015-03-12 14:35:57 +0900 (f3e4270)
@@ -0,0 +1,24 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos title COLUMN_SCALAR ShortText
+column_create Memos content COLUMN_SCALAR ShortText
+column_create Memos comment COLUMN_SCALAR ShortText
+column_create Memos category COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION \
+  Memos title,content,comment,category
+
+load --table Memos
+[
+["title", "content", "comment", "category"],
+["groonga", "Start groonga!", "groonga!", "groonga"],
+["mroonga", "Start mroonga!", "mroonga!", "mroonga"],
+["rroonga", "Start rroonga!", "rroonga!", "rroonga"],
+["Ruby", "Start Ruby!", "Ruby!", "Ruby"],
+["learn", "Learning Ruby and groonga...", "learn!", "learn"]
+]
+
+select Memos \
+  --match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] * 3 || Lexicon.memo_index[2] * 2 || Lexicon.memo_index[3] * 7" \
+  --query rroonga \
+  --output_columns "title, content, _score"
-------------- next part --------------
HTML����������������������������...
Download 



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