You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/04 15:14:59 UTC

[GitHub] [superset] rusackas commented on a change in pull request #18662: feat(viz-gallery): add 'feature' tag and fuzzy search weighting

rusackas commented on a change in pull request #18662:
URL: https://github.com/apache/superset/pull/18662#discussion_r819656707



##########
File path: superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
##########
@@ -545,7 +589,18 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) {
     if (searchInputValue.trim() === '') {
       return [];
     }
-    return fuse.search(searchInputValue).map(result => result.item);
+    return fuse
+      .search(searchInputValue)
+      .map(result => result.item)
+      .sort((a, b) => {

Review comment:
       Maybe instead of using this sort based on the label's place in the array order, we can define the labels with some basic (flexible/configurable) weighting, like this
   ```js
   const chartLabels = {
       Featured: {
           weight: 0.3
       },
       Depracated: {
           weight: -0.3
       }
   }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org