feat(viz-gallery): add search weight for viz-name (#19581)

This commit is contained in:
Stephen Liu 2022-05-13 22:51:01 +08:00 committed by GitHub
parent 1cd002e801
commit e625c03cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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],
);