From bad7e797407f820072f369813c4855aa26c9af77 Mon Sep 17 00:00:00 2001 From: Anastasia Beglova Date: Fri, 30 Jun 2023 12:57:49 -0400 Subject: [PATCH] fix --- src/search.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/search.ts b/src/search.ts index 3d46606..5d898c7 100644 --- a/src/search.ts +++ b/src/search.ts @@ -389,14 +389,16 @@ export const buildLearnQuery = ( buildSuggestQuery(text, LEARN_SUGGEST_FIELDS) ) - builder = builder.query("function_score", { - boost_mode: "replace", - script_score: { - script: { - source: "Math.round(_score*2)" - } - }, - ...orSubqueriesBuilder.build() + builder = builder.rawOption("query", { + function_score: { + boost_mode: "replace", + script_score: { + script: { + source: "Math.round(_score*2)" + } + }, + query: orSubqueriesBuilder.build() + } }) builder = builder.rawOption("sort", [