diff --git a/packages/elasticsearch-plugin/src/build-elastic-body.spec.ts b/packages/elasticsearch-plugin/src/build-elastic-body.spec.ts index e52d30887c..b9815a0f81 100644 --- a/packages/elasticsearch-plugin/src/build-elastic-body.spec.ts +++ b/packages/elasticsearch-plugin/src/build-elastic-body.spec.ts @@ -21,7 +21,8 @@ describe('buildElasticBody()', () => { multi_match: { query: 'test', type: 'best_fields', - fields: ['productName^1', 'productVariantName^1', 'description^1', 'sku^1'], + fuzziness: 'AUTO', + fields: ['productName^5', 'productVariantName^5', 'description^1', 'sku^1'], }, }, ], @@ -389,7 +390,8 @@ describe('buildElasticBody()', () => { multi_match: { query: 'test', type: 'best_fields', - fields: ['productName^1', 'productVariantName^1', 'description^1', 'sku^1'], + fuzziness: 'AUTO', + fields: ['productName^5', 'productVariantName^5', 'description^1', 'sku^1'], }, }, ], @@ -427,7 +429,8 @@ describe('buildElasticBody()', () => { multi_match: { query: 'test', type: 'phrase', - fields: ['productName^1', 'productVariantName^1', 'description^1', 'sku^1'], + fuzziness: 'AUTO', + fields: ['productName^5', 'productVariantName^5', 'description^1', 'sku^1'], }, }, ], @@ -456,6 +459,7 @@ describe('buildElasticBody()', () => { multi_match: { query: 'test', type: 'best_fields', + fuzziness: 'AUTO', fields: ['productName^3', 'productVariantName^4', 'description^2', 'sku^5'], }, }, @@ -482,7 +486,7 @@ describe('buildElasticBody()', () => { const result = buildElasticBody({ term: 'test' }, config, CHANNEL_ID, LanguageCode.en); expect(result.script_fields).toEqual({ test: { - script: 'doc[\'property\'].dummyScript(test)', + script: "doc['property'].dummyScript(test)", }, }); });