@kubun/db-adapter 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/postgres.js +1 -1
- package/lib/sqlite.js +1 -1
- package/package.json +1 -1
package/lib/postgres.js
CHANGED
|
@@ -161,7 +161,7 @@ export class AbstractPostgresAdapter {
|
|
|
161
161
|
SELECT document_id, ts_rank(search_vector, plainto_tsquery('simple', ${params.query})) AS rank
|
|
162
162
|
FROM ${sql.ref(tableName)}
|
|
163
163
|
WHERE search_vector @@ plainto_tsquery('simple', ${params.query})
|
|
164
|
-
ORDER BY rank DESC
|
|
164
|
+
ORDER BY rank DESC, document_id
|
|
165
165
|
LIMIT ${params.limit}
|
|
166
166
|
`.execute(db);
|
|
167
167
|
return results.rows.map((row)=>({
|
package/lib/sqlite.js
CHANGED
|
@@ -164,7 +164,7 @@ export class AbstractSQLiteAdapter {
|
|
|
164
164
|
const results = await sql`
|
|
165
165
|
SELECT document_id, rank FROM ${sql.ref(tableName)}
|
|
166
166
|
WHERE ${sql.ref(tableName)} MATCH ${params.query}
|
|
167
|
-
ORDER BY rank
|
|
167
|
+
ORDER BY rank, document_id
|
|
168
168
|
LIMIT ${params.limit}
|
|
169
169
|
`.execute(db);
|
|
170
170
|
return results.rows.map((row)=>({
|