-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Desktop: Resolves #10549: Add exact search for title and body of notes #10991
base: dev
Are you sure you want to change the base?
Conversation
Thanks Pedro, but regarding this:
That seems correct to me and I don't think we'd want to change this. Doing an exact search for something like |
Also why was |
Also plenty of test errors on CI - did you try running the tests? It's very obvious that if you change the search engine you need to run all search-related tests (at the very least). |
The problem is that the search seems dashes as word separators (and spaces and underslashes too). That means if you want to do an exact search with these characters you can't. That means when you search for |
|
|
Resolves #10549
Summary
On this PR I'm adding the possibility of using exact search for the title and body of notes using double quotes:
title: "2020-03-06"
title: "This is a note title with space" body: "Some other term to search"
etc
Changes:
getTerm
function works to allow search input after double quotes (explained better bellow)title:
andbody:
into phrases and words, escaping the necessary double quotesChanges to
getTerm
getTerm
is a function responsible for taking a query liketitle: something body: another thing
intoThe problem was that an input like
title: "something" other
would be parsed asI changed to associate the value after double quotes with the previous value until it finds another "term" (be it title, body, tag, etc):
Changes in the current behaviour
As I described above, this PR changes some of the search behaviour. If, for example, the user might make a complex search like so:
title: "something" -other
it will be required to change the order of the elements
-other title: "something"
to have similar output.
Testing
I added some automated tests to the new functions, but the feature can also be tested manually: