-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Fix WithExpr to accept non-ident Expr * Update testdata
- Loading branch information
Showing
4 changed files
with
834 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
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,12 @@ | ||
-- https://cloud.google.com/spanner/docs/full-text-search/ranked-search#score_multiple_columns | ||
SELECT AlbumId | ||
FROM Albums | ||
WHERE SEARCH(Title_Tokens, @p1) AND SEARCH(Studio_Tokens, @p2) | ||
ORDER BY WITH( | ||
TitleScore AS SCORE(Title_Tokens, @p1) * @titleweight, | ||
StudioScore AS SCORE(Studio_Tokens, @p2) * @studioweight, | ||
DaysOld AS (UNIX_MICROS(CURRENT_TIMESTAMP()) - ReleaseTimestamp) / 8.64e+10, | ||
FreshnessBoost AS (1 + @freshnessweight * GREATEST(0, 30 - DaysOld) / 30), | ||
PopularityBoost AS (1 + IF(HasGrammy, @grammyweight, 0)), | ||
(TitleScore + StudioScore) * FreshnessBoost * PopularityBoost) | ||
LIMIT 2 |
Oops, something went wrong.