Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #869 from komainu8/add_test_for_scorer
Browse files Browse the repository at this point in the history
scorer test: add a test to multiply the score

Patch by Yasuhiro Horimoto. Thanks!!!
  • Loading branch information
kou committed Sep 10, 2018
2 parents f1a9779 + d8ed565 commit 1f7a284
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
@@ -0,0 +1,11 @@
table_create Users TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Users tags COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
load --table Users
[
{"_key": "alice", "tags": "wonder"}
]
[[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]]]]
12 changes: 12 additions & 0 deletions test/command/suite/select/scorer/expression/multiplication.test
@@ -0,0 +1,12 @@
table_create Users TABLE_HASH_KEY ShortText
column_create Users tags COLUMN_SCALAR ShortText

load --table Users
[
{"_key": "alice", "tags": "wonder"}
]

select Users \
--filter true \
--scorer '_score = (tags @ "wonder") * 3' \
--output_columns _score

0 comments on commit 1f7a284

Please sign in to comment.