From a644fcb2331cb2748f5747019c0a583e8da772a0 Mon Sep 17 00:00:00 2001 From: kgopal Date: Fri, 18 Aug 2023 15:06:27 -0700 Subject: [PATCH] update table search boost scores --- querybook/server/lib/elasticsearch/search_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/querybook/server/lib/elasticsearch/search_table.py b/querybook/server/lib/elasticsearch/search_table.py index 2a12ff5dd..70a1af356 100644 --- a/querybook/server/lib/elasticsearch/search_table.py +++ b/querybook/server/lib/elasticsearch/search_table.py @@ -26,7 +26,7 @@ def _match_table_word_fields(fields): # 'table_name', 'description', and 'column' are fields used by Table search if field == "table_name": search_fields.append("full_name^2") - search_fields.append("full_name_ngram") + search_fields.append("full_name_ngram^0.2") elif field == "description": search_fields.append("description") elif field == "column": @@ -95,7 +95,7 @@ def construct_tables_query( "boost_mode": "sum", "script_score": { "script": { - "source": "doc['importance_score'].value * 10 + (doc['golden'].value ? 10 : 0)" + "source": "doc['importance_score'].value * 10 + (doc['golden'].value ? 50 : 0)" } }, }