Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #871 from komainu8/add_test_for_add
scorer test: add a test that adds a score Patch by Yasuhiro Horimoto. Thanks!!!
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 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] | ||
| column_create Users name COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| load --table Users | ||
| [ | ||
| {"_key": "alice", "tags": "wonder", "name": "Alice in Wonderland"} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Users --filter true --scorer '_score = (tags @ "wonder") + (name @ "Alice")' --output_columns _score | ||
| [[0,0.0,0.0],[[[1],[["_score","Int32"]],[2]]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| table_create Users TABLE_HASH_KEY ShortText | ||
| column_create Users tags COLUMN_SCALAR ShortText | ||
| column_create Users name COLUMN_SCALAR ShortText | ||
|
|
||
| load --table Users | ||
| [ | ||
| {"_key": "alice", "tags": "wonder", "name": "Alice in Wonderland"} | ||
| ] | ||
|
|
||
| select Users \ | ||
| --filter true \ | ||
| --scorer '_score = (tags @ "wonder") + (name @ "Alice")' \ | ||
| --output_columns _score |