astro-accelerator 0.3.17 → 0.3.18
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/package.json +1 -1
- package/public/js/search.js +4 -4
package/package.json
CHANGED
package/public/js/search.js
CHANGED
|
@@ -252,8 +252,8 @@ async function getSynonyms() {
|
|
|
252
252
|
* Replaces synonyms
|
|
253
253
|
* @param {string[]} queryTerms
|
|
254
254
|
*/
|
|
255
|
-
function replaceSynonyms(queryTerms) {
|
|
256
|
-
const synonyms = getSynonyms();
|
|
255
|
+
async function replaceSynonyms(queryTerms) {
|
|
256
|
+
const synonyms = await getSynonyms();
|
|
257
257
|
|
|
258
258
|
for (let i = 0; i < queryTerms.length; i++) {
|
|
259
259
|
const term = queryTerms[i];
|
|
@@ -271,7 +271,7 @@ function replaceSynonyms(queryTerms) {
|
|
|
271
271
|
* @param {number|null} [r=12]
|
|
272
272
|
* @returns
|
|
273
273
|
*/
|
|
274
|
-
function search(s, r) {
|
|
274
|
+
async function search(s, r) {
|
|
275
275
|
const numberOfResults = r ?? 12;
|
|
276
276
|
console.log('search', s, numberOfResults);
|
|
277
277
|
|
|
@@ -288,7 +288,7 @@ function search(s, r) {
|
|
|
288
288
|
currentQuery = cleanQuery;
|
|
289
289
|
/** @type {string[]} */
|
|
290
290
|
const stemmedTerms = [];
|
|
291
|
-
const queryTerms = replaceSynonyms(explode(currentQuery));
|
|
291
|
+
const queryTerms = await replaceSynonyms(explode(currentQuery));
|
|
292
292
|
|
|
293
293
|
for (const term of queryTerms) {
|
|
294
294
|
const stemmed = stemmer(term);
|