From f140e39f8b11d800ad9acecc2e629deeb42023d1 Mon Sep 17 00:00:00 2001 From: adueck Date: Fri, 25 Nov 2022 20:39:35 +0500 Subject: [PATCH] m --- website/src/lib/dictionary.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/website/src/lib/dictionary.ts b/website/src/lib/dictionary.ts index f01233a..aa7aae7 100644 --- a/website/src/lib/dictionary.ts +++ b/website/src/lib/dictionary.ts @@ -167,7 +167,7 @@ function englishLookup({ searchString, page, tpFilt .limit(exactResultsLimit) .simplesort("i") .data(); - // exactResults.sort(sortByR); + exactResults.sort(sortByR); resultsGiven = exactResults.map((mpd: any) => mpd.$loki); // get results with full word match at beginning of string const startingQuery = { @@ -182,7 +182,7 @@ function englishLookup({ searchString, page, tpFilt .limit(startingResultsLimit) .simplesort("i") .data(); - // startingResults.sort(sortByR); + startingResults.sort(sortByR); resultsGiven = [...resultsGiven, ...startingResults.map((mpd: any) => mpd.$loki)]; // get results with full word match anywhere const fullWordQuery = { @@ -197,7 +197,7 @@ function englishLookup({ searchString, page, tpFilt .limit(fullWordResultsLimit) .simplesort("i") .data(); - // fullWordResults.sort(sortByR); + fullWordResults.sort(sortByR); resultsGiven = [...resultsGiven, ...fullWordResults.map((mpd: any) => mpd.$loki)] // get results with partial match anywhere const partialMatchQuery = { @@ -214,14 +214,10 @@ function englishLookup({ searchString, page, tpFilt .simplesort("i") .data(); partialMatchResults.sort(sortByR); - const wordResults = [ + const results = [ ...exactResults, ...startingResults, ...fullWordResults, - ]; - wordResults.sort(sortByR); - const results = [ - ...wordResults, ...partialMatchResults, ]; if (tpFilter) {