Skip to content

Commit 1eaee1d

Browse files
committed
Update testdata
1 parent 810cde8 commit 1eaee1d

File tree

3 files changed

+830
-0
lines changed

3 files changed

+830
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- https://cloud.google.com/spanner/docs/full-text-search/ranked-search#score_multiple_columns
2+
SELECT AlbumId
3+
FROM Albums
4+
WHERE SEARCH(Title_Tokens, @p1) AND SEARCH(Studio_Tokens, @p2)
5+
ORDER BY WITH(
6+
TitleScore AS SCORE(Title_Tokens, @p1) * @titleweight,
7+
StudioScore AS SCORE(Studio_Tokens, @p2) * @studioweight,
8+
DaysOld AS (UNIX_MICROS(CURRENT_TIMESTAMP()) - ReleaseTimestamp) / 8.64e+10,
9+
FreshnessBoost AS (1 + @freshnessweight * GREATEST(0, 30 - DaysOld) / 30),
10+
PopularityBoost AS (1 + IF(HasGrammy, @grammyweight, 0)),
11+
(TitleScore + StudioScore) * FreshnessBoost * PopularityBoost)
12+
LIMIT 2

0 commit comments

Comments
 (0)