Repository navigation
feat(search): add fzf engine with frecency tiebreak - #359
luizhcrocha wants to merge 6 commits into
Conversation
feat(search): add fzf engine with frecency tiebreak chore(Makefile): fix formatting and syntax errors
|
After some usage... i think it's not quite there yet. Will mark as draft and try to improve and fix some problems. |
91c7492 to
e3fa456
Compare
|
Now i think it's quite nice. Added a way to quantize better so tiebreaks works more 'loosely', and let other tiebreak steps resolve close calls. Fixed a bug with unsafe code, a bad usage of fzf Slab, and, I think most importantly, and need review, is that:
|
e3fa456 to
54b746f
Compare
319eedf to
7723b1f
Compare
log2 score bucketing collapsed all real-world fzf scores into one bucket, flattening filtered results to chronological order (a consecutive boundary match could rank below scattered subsequence matches). Add a numeric linear quantization width to bucketize and default the score tiebreak to width 16 (one fzf scoreMatch unit): genuinely-close scores group so frecency decides, while clearly-better matches stay ahead.
339749b to
187b8f3
Compare
187b8f3 to
5185128
Compare
5185128 to
9876760
Compare
|
Hi @luizhcrocha, Firstly, apologies for the delay in getting back to you, and thank you for your work here. Since PR #311 addressed the fzf crash on null byte chars, the Bubbletea fzf engine seems to now be working well (I haven't seen any reports of it crashing since that was released). So, I wonder if this feature is worth the additional complexity... It's a significant amount of code changed, including 15 files, and I'm not sure the benefit is justified. Maybe I am missing something though, could you maybe add some more information on the value added here? Thank you |
|
Hi, @savedra1. No problem, I fully understand that PRs might take time. I was working on a case analysis tool for law firms and researching and fine-tuning search on file trees, and I wanted to move some findings to my clipse use, particularly the ranking and tolerance, since I got some search results that were not quite what I expected (not a failure, but just the way search is designed). So, I think the point was to give users flexibility to fiddle with how they want search to behave, have nice defaults, but I agree that this results in complexity. I, myself, never changed settings again after deciding on these: "search": {
"engine": "fzf",
"algo": "v2",
"matchMode": "fuzzy",
"caseSensitivity": "smart",
"normalize": true,
"typoTolerance": true,
"maxScatter": 24,
"tiebreak": [
{ "key": "score", "bucket": "32" },
{ "key": "frecency" },
{ "key": "length" },
"index"
]
}I thought of exposing settings because others might not like typo tolerance, fuzzy matching, case sensitivity, and so on. Overall, I'm pretty satisfied with the searching experience this provides, but it's a small improvement, and I'm really on board with you deciding the fit. |
Hi, @savedra1
I've made this to give users an option on search engine and search result optimization, so they can get the most out of the search feature, tweaking as they like.
The default is still
charmbracelet/bubblesbacked bysahilm/fuzzy, but if the user want's he can choose to usejunegunn/fzfby adding these to settings:{ "search": { "engine": "fzf", "algo": "v2", "caseSensitivity": "smart", "normalize": true, "tiebreak": ["score", "frecency", "index"] } }One thing that I think you might not like is that I changed
func sanitizedFilterto a high-order functionfunc buildFilter, because I thought that would make the code more concise.Wrote with Claude Code help, not full on vibecoded (I know some people hate this). Test was all Claude Code though.