From 003f5af65b2ce79458460958e3b9e681e11a6fc0 Mon Sep 17 00:00:00 2001 From: Stephen Liu <750188453@qq.com> Date: Fri, 13 May 2022 22:51:01 +0800 Subject: [PATCH] feat(viz-gallery): add search weight for viz-name (#19581) --- .../controls/VizTypeControl/VizTypeGallery.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx index c4055452e951c..d2efe0e92417f 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx @@ -579,7 +579,17 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) { new Fuse(chartMetadata, { ignoreLocation: true, threshold: 0.3, - keys: ['value.name', 'value.tags', 'value.description'], + keys: [ + { + name: 'value.name', + weight: 4, + }, + { + name: 'value.tags', + weight: 2, + }, + 'value.description', + ], }), [chartMetadata], );