You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search & create input box: fuzzy search is too fuzzy (causing freezes/lag) #1171
Describe the bug
in the search & create box, the fuzzy search seems too fuzzy, it tries to match single characters, reporting false matches and causing excessive lag or freeze during operation
To Reproduce
typing anything long like ttttttttttttt or aaaaaaaaaaaaa : the results will randomly hightlight single t in the middle of words like : alert or post
it seems to get worse with longer strings, I get around 8s lag when I reach 16 characters (probably choking while tryng to parse files with many bullets). in my case, the freeze on long strings makes it impossible to create new pages with long names from the search box.
Expected behavior
less distance or less fuzziness to get closer matches
@cannibalox I just give it a try, and it does improve the performance a lot. I start noticing the latency when I input 23 characters(ttttttttttttttttttttttt), and it takes about 3 seconds.
It's on logseq.com now. @cannibalox@gaofeng-bj Let me know whether it works for you.
I think emacs ivy's default search style is great.
basically, user input: "aaa bbb ccc" , then search by regex : "aaa.*?bbb.*?ccc".
and "2 <space>" input convert to "1<space>" in regex: "aaa<SPC><SPC>bbb" -> "aaa<SPC>bbb".
Wondering if fuzzysort pkg supports this search style.
@tiensonqin thanks for the commit, it seems to work better indeed !
Some search on common strings still freeze though like :this is new or this is a will usually cause heavy lag on my end, I'm not sure wheter it's caused by the size of documents or if it's an issue with the search algo (there is a post on discord by @rcvd related to the same issue as he tried to create a file containing is not the ). as @gyk mentionned, it sems fuzzysort is more suited for fuzzy matching titles, names or short strings. In long term, it might be good to look for a alternative full-text-search option, more robust...easier said than done I know : /
Still this is already much better with the fix ! thank you again
I think emacs ivy's default search style is great.
basically, user input: "aaa bbb ccc" , then search by regex : "aaa.?bbb.?ccc".
and "2 " input convert to "1" in regex: "aaabbb" -> "aaabbb".
Wondering if fuzzysort pkg supports this search style.
@RCmerci I don't think fuzzysort support this search style, the full-text support by flexsearch doesn't support fuzzy search at the moment, we might need to utilize either sqlite or even lucene for better full-text search for the desktop app.
Activity
gyk commentedon Jan 21, 2021
Related to farzher/fuzzysort#80. It seems fuzzysort is only suitable for searching short strings.
gaofeng-bj commentedon Jan 31, 2021
搜索功能有待加强
cannibalox commentedon Feb 9, 2021
@gyk I was wondering if you tried the fix mentionned on the fuzzysort thread (quote below) ?
enhance: fuzzy search causing freezes/lag
tiensonqin commentedon Feb 9, 2021
@cannibalox I just give it a try, and it does improve the performance a lot. I start noticing the latency when I input 23 characters(ttttttttttttttttttttttt), and it takes about 3 seconds.
It's on logseq.com now.
@cannibalox @gaofeng-bj Let me know whether it works for you.
RCmerci commentedon Feb 9, 2021
I think emacs ivy's default search style is great.
basically, user input: "aaa bbb ccc" , then search by regex : "aaa.*?bbb.*?ccc".
and "2 <space>" input convert to "1<space>" in regex: "aaa<SPC><SPC>bbb" -> "aaa<SPC>bbb".
Wondering if fuzzysort pkg supports this search style.
cannibalox commentedon Feb 9, 2021
@tiensonqin thanks for the commit, it seems to work better indeed !
Some search on common strings still freeze though like :
this is neworthis is awill usually cause heavy lag on my end, I'm not sure wheter it's caused by the size of documents or if it's an issue with the search algo (there is a post on discord by @rcvd related to the same issue as he tried to create a file containingis not the). as @gyk mentionned, it sems fuzzysort is more suited for fuzzy matching titles, names or short strings. In long term, it might be good to look for a alternative full-text-search option, more robust...easier said than done I know : /Still this is already much better with the fix ! thank you again
tiensonqin commentedon Feb 10, 2021
@cannibalox Yes, it doesn't solve the full-text search issue, I'm trying to use https://github.com/nextapps-de/flexsearch for this purpose, the initial result looks great, the bad thing is that it doesn't work well for non-English users by default.
cannibalox commentedon Feb 12, 2021
@tiensonqin regarding mixing languages in flexsearch, I stumbled on this topic in their github
nextapps-de/flexsearch#182
linking for future ref just in case it might come in handy
tiensonqin commentedon Feb 14, 2021
@cannibalox Thanks for the related topic, I'll cut a desktop release today with the mixing languages support.
tiensonqin commentedon Feb 14, 2021
@RCmerci I don't think fuzzysort support this search style, the full-text support by flexsearch doesn't support fuzzy search at the moment, we might need to utilize either sqlite or even lucene for better full-text search for the desktop app.
tiensonqin commentedon Feb 21, 2021
@cannibalox It should be fixed now on the browser.