Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Bugfix: Remove fuzzy search results #8508

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-remove-fuzzy-search-results
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default defineComponent({
const fuse = new Fuse(items, {
...(props.label && { keys: [props.label] }),
shouldSort: true,
threshold: 0.2,
threshold: 0.1,
location: 0,
distance: 100,
minMatchCharLength: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ export default defineComponent({
return groups
}
const groupsSearchEngine = new Fuse(groups, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: ['displayName']
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default defineComponent({
}

const searchEngine = new Fuse(collection, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: ['displayName']
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ export default defineComponent({
return spaces
}
const searchEngine = new Fuse(spaces, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: ['name']
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ export default defineComponent({
return users
}
const usersSearchEngine = new Fuse(users, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: ['displayName', 'mail', 'onPremisesSamAccountName', 'role.displayName']
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ export default defineComponent({
return collection
}
const searchEngine = new Fuse(collection, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: ['collaborator.displayName', 'collaborator.name']
})

Expand Down
4 changes: 2 additions & 2 deletions packages/web-app-files/src/helpers/resource/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.3,
threshold: 0.1,
keys: ['name', 'type', 'icon', 'extension', 'tags']
})

Expand Down
4 changes: 2 additions & 2 deletions packages/web-pkg/src/components/ItemFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ export default defineComponent({
return items
}
const usersSearchEngine = new Fuse(items, {
includeScore: true,
includeScore: false,
useExtendedSearch: true,
threshold: 0.3,
threshold: 0.1,
keys: props.filterableAttributes as any
})

Expand Down