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

Weird search behavior #3

Open
leofeyer opened this issue Jan 3, 2025 · 2 comments
Open

Weird search behavior #3

leofeyer opened this issue Jan 3, 2025 · 2 comments

Comments

@leofeyer
Copy link
Member

leofeyer commented Jan 3, 2025

Problem 1: The placeholder is "found"

Since Erlaubte Mitgliedergruppen contains a P, it is part of the search results. Chosen behaves the same weird way.

Problem 2: The fuzzy search has too many results

Neither Violin students nor Gäste (nicht angemeldet) contains a P, still they are found when searching for Pi. That is wrong IMHO and Chosen did not behave this way, either.

@zoglo Can we influence this without having to adapt the JavaScript?

@zoglo
Copy link
Contributor

zoglo commented Jan 3, 2025

@zoglo Can we influence this without having to adapt the JavaScript?

Totally!
https://www.fusejs.io/api/options.html#fuzzy-matching-options
https://www.fusejs.io/api/options.html#threshold

The current threshold is 0.6 right now to allow fuzzy search, might tweak this a little bit so we'll still have some kind of search for e.g. legasthenics?

// Choices uses the great Fuse library for searching. You
// can find more options here: https://fusejs.io/api/options.html
fuseOptions: {
  includeScore: true
},

Value and Label Search

There is more to talk about as well
https://github.com/Choices-js/Choices?tab=readme-ov-file#searchfields

We can also search for the "value" so a "1" or "2" would work on the group ids but I'd leave that as is, wdyt?

@zoglo
Copy link
Contributor

zoglo commented Jan 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants