[Groonga-commit] groonga/groonga at 8b0f19d [master] scorer test: add a test to multiply the score

Back to archive index

Yasuhiro Horimoto null+****@clear*****
Mon Sep 10 11:37:21 JST 2018


Yasuhiro Horimoto	2018-09-10 11:37:21 +0900 (Mon, 10 Sep 2018)

  Revision: 8b0f19dbb3408410bd9463fef05c8321d7a42e6f
  https://github.com/groonga/groonga/commit/8b0f19dbb3408410bd9463fef05c8321d7a42e6f

  Merged 1f7a284: Merge pull request #869 from komainu8/add_test_for_scorer

  Message:
    scorer test: add a test to multiply the score

  Added files:
    test/command/suite/select/scorer/expression/multiplication.expected
    test/command/suite/select/scorer/expression/multiplication.test

  Added: test/command/suite/select/scorer/expression/multiplication.expected (+15 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/scorer/expression/multiplication.expected    2018-09-10 11:37:21 +0900 (e1f08449e)
@@ -0,0 +1,15 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users tags COLUMN_VECTOR|WITH_WEIGHT ShortText
+[[0,0.0,0.0],true]
+table_create Tags TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Tags users_tags COLUMN_INDEX|WITH_WEIGHT Users tags
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "alice", "tags": {"wonder": 100}}
+]
+[[0,0.0,0.0],1]
+select Users   --filter true   --scorer '_score = (tags @ "wonder") * 3'   --output_columns _score
+[[0,0.0,0.0],[[[1],[["_score","Int32"]],[3]]]]

  Added: test/command/suite/select/scorer/expression/multiplication.test (+15 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/scorer/expression/multiplication.test    2018-09-10 11:37:21 +0900 (4040c57e1)
@@ -0,0 +1,15 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users tags COLUMN_VECTOR|WITH_WEIGHT ShortText
+
+table_create Tags TABLE_HASH_KEY ShortText
+column_create Tags users_tags COLUMN_INDEX|WITH_WEIGHT Users tags
+
+load --table Users
+[
+{"_key": "alice", "tags": {"wonder": 100}}
+]
+
+select Users \
+  --filter true \
+  --scorer '_score = (tags @ "wonder") * 3' \
+  --output_columns _score
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180910/1a6c296e/attachment-0001.htm 



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