kanriapp / kanri

🪐 Modern offline Kanban board app for Windows, MacOS and Linux. Built with simplicity and user experience in mind.
https://kanriapp.com
GNU General Public License v3.0
756 stars 65 forks source link

Search syntax is either broken or its syntax is odd and undocumented #711

Open MoonRubles opened 2 weeks ago

MoonRubles commented 2 weeks ago

Describe the bug

Text entered into the "search for cards..." box is not used as a string match, but instead seems to be interpreted as a set of characters that will pass search if they exist in the card in that order. I cant imagine this was intended, and probably an artifact of some regexp like search call.

To Reproduce

Make 2 cards: "test card" and "add status request" Search for test. Both cards are found, even tho "test" does not exist in the 2nd card Add a 3rd card: "request add status" This is NOT found with a search for "test". The only difference between the 2nd and 3rd cards are the order of characters.

It would seem that the search for "test" is passed if the letters t,e,s,t are found in that order in the card. So like a regexp search "t.*e.*s.*t" or a glob search "t*e*s*t"

If this was intended, please add the ability to search for a complete string, such as enclosing the search string in some type of quotes.

Another test you can do on your own boards: just starting typing "a"'s into the search box: aaaaa... and watch how the card match evolves. I got to 17 a's and matched this: "Serializable: just like having deviceSlot that is optionally serialized, add data type enum. Data: passive output only, Config: actionable by device, Ack: like data, but copy of config" !! Yes, there 17 a's in there!

trobonox commented 2 weeks ago

Thanks for reaching out about this issue. My initial attempt was to implement some kind of fuzzy search to be more lenient regarding typos, but I have also noticed that the result ends up being a lot worse than just matching words. I will assess if there's a way I can implement a better fuzzy search (maybe there's some lightweight library providing a good algorithm) or just go back to a simpler logic of matching strings.

lordofscripts commented 2 weeks ago

So far it has worked for my simple searches (on tags). However, I envision the following as a good solution for the search: