From 190b5927cbcc3c0fcd4f8bfc0a22ff8993fa7c27 Mon Sep 17 00:00:00 2001 From: Martijn Date: Fri, 20 Dec 2024 15:40:21 +0100 Subject: [PATCH] feat(elastic-search): improved default search --- package.json | 3 ++- packages/elasticsearch-plugin/src/build-elastic-body.ts | 1 + packages/elasticsearch-plugin/src/options.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f474eeee83..e92593d650 100644 --- a/package.json +++ b/package.json @@ -104,5 +104,6 @@ "eslint-plugin-import": "^2.27.5", "eslint-plugin-jsdoc": "^45.0.0", "eslint-plugin-prefer-arrow": "^1.2.3" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/packages/elasticsearch-plugin/src/build-elastic-body.ts b/packages/elasticsearch-plugin/src/build-elastic-body.ts index 3e267634c1..10823222ba 100644 --- a/packages/elasticsearch-plugin/src/build-elastic-body.ts +++ b/packages/elasticsearch-plugin/src/build-elastic-body.ts @@ -41,6 +41,7 @@ export function buildElasticBody( { multi_match: { query: term, + fuzziness: "AUTO", type: searchConfig.multiMatchType, fields: [ `productName^${searchConfig.boostFields.productName}`, diff --git a/packages/elasticsearch-plugin/src/options.ts b/packages/elasticsearch-plugin/src/options.ts index 664e42387a..f37bb65dc1 100644 --- a/packages/elasticsearch-plugin/src/options.ts +++ b/packages/elasticsearch-plugin/src/options.ts @@ -728,8 +728,8 @@ export const defaultOptions: ElasticsearchRuntimeOptions = { totalItemsMaxSize: 10000, multiMatchType: 'best_fields', boostFields: { - productName: 1, - productVariantName: 1, + productName: 5, + productVariantName: 5, description: 1, sku: 1, },