GNOME Bugzilla – Bug 551097
It is not possible to search for phrases
Last modified: 2009-10-04 00:48:03 UTC
When trying to search for a phrase withing a tomboy note or with the "Search All Notes" function, it is not possible to search for a phrase. For example: Searching for "of related" shows all the words containing an "of" like "Microsoft", "offerings" or "office", as well as all single "of"s (without "related" following), and also all the words containing "related". In my op pinion it should only show exact matches to "of related", including the space. Or, if it's intention to search for words with a disjunction, it should at least be possible, for example when entering "'of related'" (with quotes). Other information:
Yeah, putting a phrase in quotes of any kind should do an exact phrase match. Low priority, though, because I don't think this is a very common use case.
Ok, sounds good. Although I think, this shouldn't be too hard to implement. Something like "if input[0] == " and input[-1] == " then search_for(whole phrase) else search_for(single words) end ? :)
Patches welcome. ;-)
Created attachment 134320 [details] [review] Patch to search for "whole statements"
OK, here's the patch! Would be glad though, if someone could review it, as I never did anything with mono / .net before. By the way, I think I found a bug in the search: When adding the words "word1 word3 word2" into a new note, and then do a search (with ctrl+f) for "word1 word2 word3" it marks all the three words found, as it should, but hitting next will make the marked text jump from word1 to word2 and back, and never touches word3. Does that happen with you, too? Should I file a new bug for that?
Thanks for the patch, will review shortly. :-)
I tried this out by adding the phrase 'a b c' (with no quotes) a couple of times to a note of mine. Searching for the phrase '"a b c"'(with just the double-quotes) worked perfectly with ctrl+f from inside a note. Awesome! Hitting "next" jumped from result to result perfectly, btw. Searching for the phrase '"a b c"' (with just the double-quotes) failed in the Search All Notes window. So I'm not totally sure what's up, but this isn't quite ready. Also, our code is now in git, not SVN, so you'll want to make sure you're using our latest code from git while developing: http://live.gnome.org/Tomboy/Developers http://live.gnome.org/Git/Developers This is a good start!
Created attachment 135186 [details] [review] patch implementing it globally, and not just within notes
That's true, I only implemented it in the search function inside the notes, and not globally. That should be fixed now, also it is a patch against git now, see the new attachment.
Awesome, I pushed this with a minor whitespace fix, and I added a reference to this bug in the commit message. Thanks for this fix!
(In reply to comment #10) > Awesome, I pushed this with a minor whitespace fix, and I added a reference to > this bug in the commit message. Thanks for this fix! > Wow, great, that was fast ;-) Now I just wondered if this shouldn't be documented somewhere in the manual? Does someone take care of that? Otherwise it is pretty useless if no one knows about it...
(In reply to comment #11) > Now I just wondered if this shouldn't be documented somewhere in the manual? > Does someone take care of that? Otherwise it is pretty useless if no one knows > about it... I usually don't look at doing documentation updates until the end of the cycle, but if you would like to update the docs, feel free to send in another great patch. ;-)