-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(query): fix incorrect matching of Thai characters in FTS5 (#216)
- Loading branch information
1 parent
495b74f
commit a60df73
Showing
3 changed files
with
42 additions
and
7 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
29 changes: 29 additions & 0 deletions
29
query/match_subject_object_geom_intersects_autocomplete.sql
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,29 @@ | ||
SELECT | ||
t1.id AS subjectId, | ||
t2.id as objectId | ||
FROM fulltext f1 | ||
JOIN tokens t1 ON f1.rowid = t1.rowid | ||
JOIN rtree AS r1 ON t1.id = r1.id | ||
JOIN rtree AS r2 ON ( | ||
r1.maxZ < r2.minZ AND | ||
(r1.minX - $threshold) < r2.maxX AND | ||
(r1.maxX + $threshold) > r2.minX AND | ||
(r1.minY - $threshold) < r2.maxY AND | ||
(r1.maxY + $threshold) > r2.minY | ||
) | ||
JOIN fulltext AS f2 ON f2.fulltext MATCH $object_quoted OR $object_quoted* | ||
JOIN tokens t2 ON ( | ||
f2.rowid = t2.rowid | ||
AND r2.id = t2.id | ||
AND (t2.token = $object OR t2.token LIKE ($object || '%')) | ||
AND ( | ||
t1.lang = t2.lang OR | ||
t1.lang IN ('eng', 'und') OR | ||
t2.lang IN ('eng', 'und') | ||
) | ||
) | ||
WHERE f1.fulltext MATCH $subject_quoted | ||
AND t1.token = $subject | ||
GROUP BY t1.id, t2.id | ||
ORDER BY t1.id ASC, t2.id ASC | ||
LIMIT $limit |