From 633c4d573c4894bc65f66f0d2c501b50775113b4 Mon Sep 17 00:00:00 2001 From: Daniel Saul Date: Fri, 4 Dec 2020 19:10:04 +0000 Subject: [PATCH] feat: sort search results by score --- packages/content/lib/query-builder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/content/lib/query-builder.js b/packages/content/lib/query-builder.js index 84d3977a7..8c2c935ab 100644 --- a/packages/content/lib/query-builder.js +++ b/packages/content/lib/query-builder.js @@ -115,7 +115,8 @@ class QueryBuilder { } } - this.query = this.query.find({ $fts }) + this.query = this.query.find({ $fts }).sortByScoring() + return this }