Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #870 from komainu8/add_test_to_reference_column_score
Browse files Browse the repository at this point in the history
scorer test: add a test for a score of reference to a vector column

Patch by Yasuhiro Horimoto. Thanks!!!
  • Loading branch information
kou committed Sep 11, 2018
2 parents 02d8a47 + 9576d79 commit 0886781
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/command/suite/select/scorer/expression/reference.expected
@@ -0,0 +1,13 @@
table_create Users TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
table_create Tag TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Users tags COLUMN_VECTOR Tag
[[0,0.0,0.0],true]
load --table Users
[
{"_key": "alice", "tags": ["book", "people"]}
]
[[0,0.0,0.0],1]
select Users --filter true --scorer '_score = (tags._key != "")' --output_columns _score
[[0,0.0,0.0],[[[1],[["_score","Int32"]],[1]]]]
11 changes: 11 additions & 0 deletions test/command/suite/select/scorer/expression/reference.test
@@ -0,0 +1,11 @@
table_create Users TABLE_HASH_KEY ShortText
table_create Tag TABLE_HASH_KEY ShortText
column_create Users tags COLUMN_VECTOR Tag
load --table Users
[
{"_key": "alice", "tags": ["book", "people"]}
]
select Users \
--filter true \
--scorer '_score = (tags._key != "")' \
--output_columns _score

0 comments on commit 0886781

Please sign in to comment.