Bug 298245 - google like search behaviour in quick search
Summary: google like search behaviour in quick search
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: commands and actions (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-16 13:17 UTC by Johannes K.
Modified: 2013-06-05 22:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9


Attachments
highlighting of search result in microsoft outlook (25.49 KB, image/png)
2012-04-25 14:33 UTC, Johannes K.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes K. 2012-04-16 13:17:47 UTC
Hello

I would like to have a similar behavour in quick search (the search field on top fo the e-mail list) like google.
I especially mean that if I write two words with a space as a seperator it will search for email which includes these words. If I sorround them with double quotes than it should search for this specific string "word1 word2".

Thanks a lot!

Reproducible: Always
Comment 1 Laurent Montel 2012-04-16 14:07:44 UTC
no :)
We will not force user to quote string when he search a specific string.
by default we search a string not 2 words in text.
Otherwise we use search dialog box
Comment 2 Johannes K. 2012-04-16 14:22:41 UTC
I respect your desicion.
Let me suggest s.th. different.
I've found the search dialog box to complicated for quick searchs when I only wanna search for a email which includes two or more words very quickly.
Could it be possible to add a small plus button to the quick search which (similar to the one in the search box) adds another line under the quick search for another word.
I don't wanna have there a dropdown menu where to search. Just another input field for a second or third word.
Comment 3 Laurent Montel 2012-04-16 14:58:59 UTC
I looked at thunderbird and it uses all the time: I especially mean that if I write two words with a space as a seperator it will search for email which includes these words. 
and doesn't look at for specific string.

So perhaps we can add this feature.
Will look at.

but comment #3 no we can't add more widget for it.
Comment 4 Laurent Montel 2012-04-25 07:19:03 UTC
Git commit a95524cd7323c722d18133d38a0d3705d14bd3e7 by Montel Laurent.
Committed on 25/04/2012 at 09:17.
Pushed by mlaurent into branch 'master'.

Fix Bug 298245 - google like search behaviour in quick search

now we can search in search line as separate string. So it will improve
search.

FIXED-IN: 4.9

M  +19   -3    messagelist/core/filter.cpp
M  +4    -2    messagelist/core/filter.h

http://commits.kde.org/kdepim/a95524cd7323c722d18133d38a0d3705d14bd3e7
Comment 5 Johannes K. 2012-04-25 12:11:34 UTC
Hi Laurent

That's wonderful and so fast. Thank you very much!!!

I wonder if you could have the old behaviour if you you quotes ( " or ' ) around your search words.

It would be also great if the search uses the body of the e-mail too if the emails are indexed. Outlook does it for example (I just checked it at a compute of a friend) and I think thunderbird too though I'm not quite sure. If this behaviour would be available a new sorting algorithm would be great too which shows the email more above when the result is found in the receiver, sender, subject and bei the number of results in the body.
A nice to have would be also to show the results highlighted.

I know you probably will say: "For this we have the search dialog box". But this kind of search I do very frequently every day and it is a pain to always open the search dialog box and it includes so mach clicking with the mouse until I've got my search query. I also like to have the result right in my email list which appearance I have configured and I'm comfortable with. It should also only apply to the emails of the folder I'm currently in.
When I want to see the email in the search result of the search dialog box I always have to open the email in a new window which is another click to close it again and it is just not my way to browse through my email which opens always on the right side of my email list in the preview panel.

I totally see a need of the search dialog box but only of really complex queries which could also include a certain time period.

I'm very open to open a discussion for this kind of behaviour in a forum. Could you point me to the best place where I could open a post?

Thanks again for your work!!!

Johannes
Comment 6 Laurent Montel 2012-04-25 13:46:36 UTC
"I wonder if you could have the old behaviour if you you quotes ( " or ' ) around your search words." will look at it.

"It would be also great if the search uses the body of the e-mail too if the emails are indexed. Outlook does it for example (I just checked it at a compute of a friend) and I think thunderbird too though I'm not quite sure. If this behaviour would be available a new sorting algorithm would be great too which shows the email more above when the result is found in the receiver, sender, subject and bei the numb" we already do in 4.9


"A nice to have would be also to show the results highlighted. " ?
Comment 7 Johannes K. 2012-04-25 14:33:59 UTC
Created attachment 70652 [details]
highlighting of search result in microsoft outlook
Comment 8 Johannes K. 2012-04-25 14:34:47 UTC
Thanks that you will look at this quote thing.

I asked for the body because I could find it in the filter.cpp

74 bool searchMatches = false;
75 if ( containString(item->subject()) )
76   searchMatches = true;
77 else if ( containString(item->sender()) )
78   searchMatches = true;
79 else if ( containString(item->receiver()) )
80  searchMatches = true;
81	
82 if ( !searchMatches )
83   return false;

results highlighted => please look at attachment
Comment 9 Johannes K. 2012-04-25 14:36:44 UTC
sorry...but I ment of course:

I asked for the body because I could NOT find it in the filter.cpp

:-)
Comment 10 Laurent Montel 2012-04-25 16:56:15 UTC
code for test body it's not here :)
But it works.

Ok see how outlook works but not easy to do it. Will look at if for 4.10 (not 4.9)
Comment 11 Emre 2013-06-05 22:17:34 UTC
Hi,
Very interesting bug report. I'm a Thunderbird convert from Outlook and now I'm trying to go back to KDE with Kmail2 on the right track.  I'm a heavy mail user for work, emails on Exchange, i'm connecting with IMAP to my exchange server. I receive 150+ emails a day on many different subjects and people.

In Outlook and also in Thunderbird, I ue exactly what Johannes mentioned. It's built-in to  Outlook if you have Windows Search and for Thunderbird, you need to install "GmailUI/ExpressionSearch" addon. Then in the search line (bar), you can just say:

from:aaaa subject:bbb
and you get related emails listed right below. If you need a specific string, you can do "my specific string" type of query, while if you want only mails which contain all of them to appear, you just type word1 word2 word3.
In Thunderbird, you can choose in the buttons just below search box if you want this search to be on the "subject" and/or "body" and/or "from" and/or "to". This is also nice when you want to limit things.

Laurent, do you think such search expression is possible to implement?  I use this like 40-50 times a day maybe more and I'm suffering also from what Johannes mentioned, opening the "advanced search" window and doing search there by selecting search fields & search strings is too much time consuming.

I see this bug report is "resolved fixed". Shall I open new bug report?