From 215a29b44ac9dea02a7ea4c3550bf770cba9cfe6 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 27 Feb 2023 11:51:25 +0100 Subject: [PATCH 1/3] Remove fuzzyness from all fuse queries --- packages/design-system/src/components/OcSelect/OcSelect.vue | 2 +- .../web-app-admin-settings/src/components/Groups/GroupsList.vue | 2 +- .../src/components/Spaces/SideBar/MembersPanel.vue | 2 +- .../web-app-admin-settings/src/components/Spaces/SpacesList.vue | 2 +- .../web-app-admin-settings/src/components/Users/UsersList.vue | 2 +- .../src/components/SideBar/Shares/SpaceMembers.vue | 2 +- packages/web-app-files/src/helpers/resource/filter.ts | 2 +- packages/web-pkg/src/components/ItemFilter.vue | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/design-system/src/components/OcSelect/OcSelect.vue b/packages/design-system/src/components/OcSelect/OcSelect.vue index 5266586a854..05499b8e424 100644 --- a/packages/design-system/src/components/OcSelect/OcSelect.vue +++ b/packages/design-system/src/components/OcSelect/OcSelect.vue @@ -68,7 +68,7 @@ export default defineComponent({ const fuse = new Fuse(items, { ...(props.label && { keys: [props.label] }), shouldSort: true, - threshold: 0.2, + threshold: 0.0, location: 0, distance: 100, minMatchCharLength: 1 diff --git a/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue b/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue index bda4c286d43..0030e90066e 100644 --- a/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue +++ b/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue @@ -250,7 +250,7 @@ export default defineComponent({ const groupsSearchEngine = new Fuse(groups, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['displayName'] }) diff --git a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue index b9635f761c7..6684c1df430 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue @@ -48,7 +48,7 @@ export default defineComponent({ const searchEngine = new Fuse(collection, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['displayName'] }) diff --git a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue index 477afcd94bc..d79b220d644 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue @@ -218,7 +218,7 @@ export default defineComponent({ const searchEngine = new Fuse(spaces, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['name'] }) diff --git a/packages/web-app-admin-settings/src/components/Users/UsersList.vue b/packages/web-app-admin-settings/src/components/Users/UsersList.vue index a45f843b6f6..a8425cee53b 100644 --- a/packages/web-app-admin-settings/src/components/Users/UsersList.vue +++ b/packages/web-app-admin-settings/src/components/Users/UsersList.vue @@ -301,7 +301,7 @@ export default defineComponent({ const usersSearchEngine = new Fuse(users, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['displayName', 'mail', 'onPremisesSamAccountName', 'role.displayName'] }) diff --git a/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue b/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue index bce7e2a61e0..711f56750cb 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue @@ -145,7 +145,7 @@ export default defineComponent({ const searchEngine = new Fuse(collection, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['collaborator.displayName', 'collaborator.name'] }) diff --git a/packages/web-app-files/src/helpers/resource/filter.ts b/packages/web-app-files/src/helpers/resource/filter.ts index 57608f053b5..dff9ebaa626 100644 --- a/packages/web-app-files/src/helpers/resource/filter.ts +++ b/packages/web-app-files/src/helpers/resource/filter.ts @@ -4,7 +4,7 @@ export const filterResources = (resources: unknown[], term: string, limit?: numb const engine = new Fuse(resources, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: ['name', 'type', 'icon', 'extension', 'tags'] }) diff --git a/packages/web-pkg/src/components/ItemFilter.vue b/packages/web-pkg/src/components/ItemFilter.vue index 8ec69847105..26236d80afd 100644 --- a/packages/web-pkg/src/components/ItemFilter.vue +++ b/packages/web-pkg/src/components/ItemFilter.vue @@ -160,7 +160,7 @@ export default defineComponent({ const usersSearchEngine = new Fuse(items, { includeScore: true, useExtendedSearch: true, - threshold: 0.3, + threshold: 0.0, keys: props.filterableAttributes as any }) From b5c653d473813e7db0ad3112c38dce9416468b80 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 27 Feb 2023 11:54:50 +0100 Subject: [PATCH 2/3] Add changelog --- changelog/unreleased/bugfix-remove-fuzzy-search-results | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/bugfix-remove-fuzzy-search-results diff --git a/changelog/unreleased/bugfix-remove-fuzzy-search-results b/changelog/unreleased/bugfix-remove-fuzzy-search-results new file mode 100644 index 00000000000..e7ae4a4219d --- /dev/null +++ b/changelog/unreleased/bugfix-remove-fuzzy-search-results @@ -0,0 +1,6 @@ +Bugfix: Remove fuzzy search results + +We've had a bug that caused some search results to show up that didn't align with the search term. + +https://github.com/owncloud/web/pull/8508 +https://github.com/owncloud/web/issues/8493 \ No newline at end of file From c09e398950b56f973c3f057fd96d393c9e69303e Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 27 Feb 2023 12:13:52 +0100 Subject: [PATCH 3/3] Fix query is part of result --- packages/design-system/src/components/OcSelect/OcSelect.vue | 2 +- .../src/components/Groups/GroupsList.vue | 4 ++-- .../src/components/Spaces/SideBar/MembersPanel.vue | 4 ++-- .../src/components/Spaces/SpacesList.vue | 4 ++-- .../web-app-admin-settings/src/components/Users/UsersList.vue | 4 ++-- .../src/components/SideBar/Shares/SpaceMembers.vue | 4 ++-- packages/web-app-files/src/helpers/resource/filter.ts | 4 ++-- packages/web-pkg/src/components/ItemFilter.vue | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/design-system/src/components/OcSelect/OcSelect.vue b/packages/design-system/src/components/OcSelect/OcSelect.vue index 05499b8e424..ff85f6d0b6a 100644 --- a/packages/design-system/src/components/OcSelect/OcSelect.vue +++ b/packages/design-system/src/components/OcSelect/OcSelect.vue @@ -68,7 +68,7 @@ export default defineComponent({ const fuse = new Fuse(items, { ...(props.label && { keys: [props.label] }), shouldSort: true, - threshold: 0.0, + threshold: 0.1, location: 0, distance: 100, minMatchCharLength: 1 diff --git a/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue b/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue index 0030e90066e..b02bb1f1c74 100644 --- a/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue +++ b/packages/web-app-admin-settings/src/components/Groups/GroupsList.vue @@ -248,9 +248,9 @@ export default defineComponent({ return groups } const groupsSearchEngine = new Fuse(groups, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['displayName'] }) diff --git a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue index 6684c1df430..7636ba32c73 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue @@ -46,9 +46,9 @@ export default defineComponent({ } const searchEngine = new Fuse(collection, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['displayName'] }) diff --git a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue index d79b220d644..8f05f3a8283 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue @@ -216,9 +216,9 @@ export default defineComponent({ return spaces } const searchEngine = new Fuse(spaces, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['name'] }) diff --git a/packages/web-app-admin-settings/src/components/Users/UsersList.vue b/packages/web-app-admin-settings/src/components/Users/UsersList.vue index a8425cee53b..67dbca49fa6 100644 --- a/packages/web-app-admin-settings/src/components/Users/UsersList.vue +++ b/packages/web-app-admin-settings/src/components/Users/UsersList.vue @@ -299,9 +299,9 @@ export default defineComponent({ return users } const usersSearchEngine = new Fuse(users, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['displayName', 'mail', 'onPremisesSamAccountName', 'role.displayName'] }) diff --git a/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue b/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue index 711f56750cb..5c8009073d5 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/SpaceMembers.vue @@ -143,9 +143,9 @@ export default defineComponent({ return collection } const searchEngine = new Fuse(collection, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['collaborator.displayName', 'collaborator.name'] }) diff --git a/packages/web-app-files/src/helpers/resource/filter.ts b/packages/web-app-files/src/helpers/resource/filter.ts index dff9ebaa626..d3788385a9d 100644 --- a/packages/web-app-files/src/helpers/resource/filter.ts +++ b/packages/web-app-files/src/helpers/resource/filter.ts @@ -2,9 +2,9 @@ import Fuse from 'fuse.js' export const filterResources = (resources: unknown[], term: string, limit?: number): unknown[] => { const engine = new Fuse(resources, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: ['name', 'type', 'icon', 'extension', 'tags'] }) diff --git a/packages/web-pkg/src/components/ItemFilter.vue b/packages/web-pkg/src/components/ItemFilter.vue index 26236d80afd..97da084ed83 100644 --- a/packages/web-pkg/src/components/ItemFilter.vue +++ b/packages/web-pkg/src/components/ItemFilter.vue @@ -158,9 +158,9 @@ export default defineComponent({ return items } const usersSearchEngine = new Fuse(items, { - includeScore: true, + includeScore: false, useExtendedSearch: true, - threshold: 0.0, + threshold: 0.1, keys: props.filterableAttributes as any })