Is there a way to sort results by preferred directories? #2796
-
Doubtful as it's probably too specific of a use case, but is there a way to sort results by preferred directories with ripgrep and/or fzf? I have a bunch of notes as text files at particular locations that I would prefer to take priority (shown at top). Thanks. Unrelated question: should one make any effort to ignore directories containing e.g. many binary files and databases to improve performance? I know rigrep ignores binaries by default, but they would still need to be checked unless you ignore the directory that contains them. I'm guessing this will rarely have any noticeable impact on performance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No. It doesn't really make sense for ripgrep to do something like this. It makes a lot more sense for you to use ripgrep to implement it though. You can run multiple searches. Maybe the first search only searches high priority things, while the second search searches lower priority things. Otherwise, ripgrep doesn't really have a notion of relevance, other than the "smart" filtering it does by default. That is, it very explicitly does not rank results and never will. (If you want ranked results, then you probably want an informational retrieval system.)
It's impossible to answer this in the abstract. Why not try it? |
Beta Was this translation helpful? Give feedback.
No. It doesn't really make sense for ripgrep to do something like this. It makes a lot more sense for you to use ripgrep to implement it though. You can run multiple searches. Maybe the first search only searches high priority things, while the second search searches lower priority things. Otherwise, ripgrep doesn't really have a notion of relevance, other than the "smart" filtering it does by default. That is, it very explicitly does not rank results and never will. (If you want ranked results, then you probably want an informational retrieval system.)