Skip to content

search & create input box: fuzzy search is too fuzzy (causing freezes/lag) #1171

Closed

Description

@cannibalox

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

Screenshots
image

win10 chromium 87

Activity

  1. added
    :type/bug
    on Jan 21, 2021
  2. gyk commented on Jan 21, 2021

    @gyk
    Contributor

    Related to farzher/fuzzysort#80. It seems fuzzysort is only suitable for searching short strings.

  3. gaofeng-bj commented on Jan 31, 2021

    @gaofeng-bj

    搜索功能有待加强

  4. cannibalox commented on Feb 9, 2021

    @cannibalox
    Author

    @gyk I was wondering if you tried the fix mentionned on the fuzzysort thread (quote below) ?

    We did a fix to prevent those kind of Infinite loop , You can take a look at our fork commit getstation@003352b

  5. tiensonqin commented on Feb 9, 2021

    @tiensonqin
    Contributor

    @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.

  6. RCmerci commented on Feb 9, 2021

    @RCmerci
    Contributor

    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.

  7. cannibalox commented on Feb 9, 2021

    @cannibalox
    Author

    @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

  8. tiensonqin commented on Feb 10, 2021

    @tiensonqin
    Contributor

    @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.

  9. cannibalox commented on Feb 12, 2021

    @cannibalox
    Author

    @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

  10. tiensonqin commented on Feb 14, 2021

    @tiensonqin
    Contributor

    @cannibalox Thanks for the related topic, I'll cut a desktop release today with the mixing languages support.

  11. tiensonqin commented on Feb 14, 2021

    @tiensonqin
    Contributor

    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.

  12. tiensonqin commented on Feb 21, 2021

    @tiensonqin
    Contributor

    @cannibalox It should be fixed now on the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    :type/bugsearch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions