Skip to content
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

Changing the file filtering logic for match-query to AND instead of OR #5089

Closed
1 of 3 tasks
hungvvu opened this issue Apr 6, 2024 · 1 comment
Closed
1 of 3 tasks
Labels
enhancement This is an enhancement to a feature of Zettlr.

Comments

@hungvvu
Copy link
Contributor

hungvvu commented Apr 6, 2024

Description

Currently, the filter functionality on the file manager pane seems to return a result as long as it contains at least one word from the query string.

Proposed Changes

Personally, I think that having it match all the words in the query string would be more helpful, as the number of results would get narrowed down further instead of expanding when the user enters in more words.

For example, if you want to quickly filter out all definitions related to signal processing, you would be able to use something like "#definition #signal-processing" to achieve that if the filter matches against all the queried words. At the moment, because of the way the matchQuery function is implemented, if you use the mentioned query the result returned will be all definitions notes and all signal processing notes. There could be some use cases that I haven't discovered yet where this could come in handy, but in my note base having that many matches is rarely helpful as I will just have to dig through them myself.

Is there a particular reason the matching logic is the way it is? If not, I would say that I see more use cases for the AND matching logic instead of the current OR matching. I'm curious to know what you think.

Caveats

The only thing I can think of is probably an increase in response time for the filter function due to more checking with in matchQuery. However, given its current speed, I don't think that's something to be too concerned about. In addition, I think that as long as it is faster than the full-text search, it will provide good value as a tool to quickly pull up certain notes/topics.

Do you Wish to Attempt Implementing this Yourself?

Yes

Zettlr Version

Stable (most recent version)

Your Platform

  • Windows
  • macOS
  • Linux

Operating System Version

Windows 11

Additional Information

No response

@hungvvu hungvvu added the enhancement This is an enhancement to a feature of Zettlr. label Apr 6, 2024
@nathanlesage
Copy link
Member

Fixed in fad35c4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement to a feature of Zettlr.
Projects
Status: Done
Development

No branches or pull requests

2 participants