-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Unordered Tokens Search #378
Comments
If doable, I'd love for semicolon |
The semicolon can replace the comma, but not the slash (already used as pattern delimitor). |
A few notes. Such a search would be very similar to the composite search
but
|
Thats a good point:
I'd prefer it to be either case-insensitive or configurable. Also, is the composite search unordered? |
Composite search is unordered, yes. You can have parts apply to the name, the subpath, the file content, and the only impact of the order is the time it takes to do the search. |
The "unordered-tokens" branch contains a first implementation. You can search on names with There's no scoring function now: either it matches or it doesn't. I'm not sure whether I'll add a real one (maybe just the total length as a malus). Remaining tasks:
Feedback very welcome |
It's now on master |
Man, you move fast. I'll gladly test it, but I won't get around to it before saturday. |
I just tested the feature for a while now, here's my feedback.
Not sure if any more ranking/scoring magic is actually required. The beauty of the unordered token search is that you can always append something to further narrow the match list. I'd probably not notice a more sophisticated scoring mechanism.
(same goes for the
Seems like a great experience so far, thanks for implementing it! Cheers. |
3: I'll start without more precise ranking because it's very expensive (if you want to rank, you have to test all possible positions) 4: Thanks for noticing this bug. I'm fixing it. 5: Yes
|
cool, thanks for elaborating. One more thing, is the token delimiter |
I finally decided against making this configurable, and I think I had a better idea: you can use both the comma and the semicolon and the first found is the separator. Combined with filtering out empty tokens, it makes possible to have one of them in your tokens. For example, when searching When searching |
Works for me. One more thing, I just tested the configuration, and the following config does not seem to work for me, default is not token search.
|
It's "tokens", not "token". I'll change so that there's an error on launch when a search mode isn't understood. |
Thank you, Another thing I noticed: |
It's documented here: https://dystroy.org/broot/conf_file/#search-modes |
related: 872c9cd |
Closing the issue. |
The goal is to be able to find paths like "/home/user/path2/subpath/Documents/"
by typing the "sub", "doc", and "2" discriminant tokens.
It would probably more naturally be applied to subpaths.
A syntax could probably be
with "up" the search mode selector, which the user would remap or remove at will (see https://dystroy.org/broot/conf_file/#search-modes)
and the comma separator could be changed to another character (with limited freedom here)
The text was updated successfully, but these errors were encountered: