After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551097 - It is not possible to search for phrases
It is not possible to search for phrases
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
0.10.x
Other All
: Low enhancement
: ---
Assigned To: Tomboy Maintainers
Tomboy Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-06 10:06 UTC by Jan Rüegg
Modified: 2009-10-04 00:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Patch to search for "whole statements" (912 bytes, patch)
2009-05-09 20:32 UTC, Jan Rüegg
needs-work Details | Review
patch implementing it globally, and not just within notes (2.12 KB, patch)
2009-05-22 17:45 UTC, Jan Rüegg
committed Details | Review

Description Jan Rüegg 2008-09-06 10:06:55 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:
Comment 1 Sandy Armstrong 2009-05-08 02:23:40 UTC
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.
Comment 2 Jan Rüegg 2009-05-09 17:19:16 UTC
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 ? :)
Comment 3 Sandy Armstrong 2009-05-09 17:36:17 UTC
Patches welcome.  ;-)
Comment 4 Jan Rüegg 2009-05-09 20:32:17 UTC
Created attachment 134320 [details] [review]
Patch to search for "whole statements"
Comment 5 Jan Rüegg 2009-05-09 20:32:54 UTC
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?
Comment 6 Sandy Armstrong 2009-05-11 16:08:12 UTC
Thanks for the patch, will review shortly.  :-)
Comment 7 Sandy Armstrong 2009-05-21 03:43:00 UTC
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!
Comment 8 Jan Rüegg 2009-05-22 17:45:55 UTC
Created attachment 135186 [details] [review]
patch implementing it globally, and not just within notes
Comment 9 Jan Rüegg 2009-05-22 17:46:31 UTC
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.
Comment 10 Sandy Armstrong 2009-05-24 13:36:43 UTC
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!
Comment 11 Jan Rüegg 2009-05-29 18:16:48 UTC
(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...
Comment 12 Sandy Armstrong 2009-06-02 17:51:13 UTC
(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.  ;-)