The default bug view has changed. See this FAQ.

should search newest first - searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases

RESOLVED FIXED in Thunderbird 24.0

Status

Thunderbird
Search
--
enhancement
RESOLVED FIXED
8 years ago
4 years ago

People

(Reporter: Pawel Pohl, Assigned: Magnus Melin)

Tracking

({polish})

Thunderbird 24.0
polish

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 FirePHP/0.2.1
Build Identifier: 2.0.0.17

I have migrated to Thunderbird from Outlook because Outlook's search feature was too slow. I have imported a database with 2 years worth of emails. Thunderbird's search is faster, but it starts with the *oldest* messages; that means that for full body searches (ex.: body contains: "new ftp password") I have to wait 5+ minutes to get to newer (more relevant) messages.

I know that I can limit the messages to, say, last 100 days or 400 days; however, I usually don't know how many days ago the relevant message was sent. Besides, that is an ugly and non-elegant solution.

Reproducible: Always

Steps to Reproduce:
1. Get a big email database
2. Start either a simple or advanced search using "body contains".
Actual Results:  
The search takes a long time (which is OK given the data size), result list is updated on-the-fly (which is very good), but oldest results appear first (which is undesired).

Expected Results:  
The results appear starting from most recent messages.

I am doing a local search, not an IMAP search. 

I am marking this bug/feature request as "major", because it makes one of the most used functions (search) unusable in my case.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 439697
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Status: UNCONFIRMED → NEW
Ever confirmed: true
Steps to Reproduce:
1. Get a big email database
2. Start either a simple or advanced search using "body contains".
Actual Results:  
The search takes a long time (which is OK given the data size), result list is
updated on-the-fly (which is very good), but oldest results appear first (which
is undesired).

Expected Results:  
The results appear starting from most recent messages.
(Reporter)

Comment 3

8 years ago
Ludo(In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of bug 439697 ***

This is a completely different bug. Note that I am not complaining about the ordering of the display list. I am complaining about the order in which the messages are *searched*.

I am very disappointed to see this bug unresolved for so long. I have just come back to this issue after trying to find another message from three weeks ago. I entered the search term, and the search started about 5 minutes ago. I managed to navigate here and find this thread and write this comment, and the search result page is only half-way through 2008. Please, please change the order in which the messages are *searched*. Searching is not an instantaneous procedure, it takes a lot of time, which is why I presume the search results list is updated live.

I marked this as "polish" because, while I am ignorant to the underlying code, I suspect that it will only require a small change in the searching code. Correct me if I am wrong.
Component: General → Folder and Message Lists
Keywords: polish
Version: unspecified → 2.0
Search is being completely rewritten in TB 3.0 - the new functionality should be released pretty soon - we will make announces mdat and on blogs - give it a go and tell us if it solves your issue.
(Reporter)

Comment 5

8 years ago
Thanks, I will make sure to update as soon as Tbird 3 is out!
QA Contact: general → folders-message-lists
(Assignee)

Updated

8 years ago
Severity: major → enhancement
OS: Windows XP → All
Hardware: x86 → All
Summary: Searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases → should search newest first - searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases

Updated

6 years ago
Duplicate of this bug: 645984

Updated

6 years ago
Duplicate of this bug: 647828

Comment 8

6 years ago
I am using Thunderbird 3.1.8 on Ubuntu and this is not solved yet.

I see this bug registered for version 2.0. Should I register a new bug?
(Assignee)

Updated

6 years ago
Duplicate of this bug: 699392

Updated

6 years ago

Comment 10

5 years ago
Still not fixed more than two years later in Thunderbird 8 ! Please please fix this!

Comment 11

5 years ago
I am using TB 12 and its still not solved! Please fix this!

Comment 12

5 years ago
In ver 15, this still executes the search from oldest to newest.   Evil, with large data sets when searching through the body [for text].

May I suggest either a default direction reversed, into Ver 16 or 17, or allow for directional suggestions in the UI

Couldn't be a huge change, here, could it ?

Can anyone pinpoint the code where the search is called . . . I'll take a look, if someone gives me a starting point.

Comment 13

5 years ago
Still "upside down" search order in Ver 16.0.1
(Assignee)

Comment 14

5 years ago
Created attachment 671123 [details] [diff] [review]
proposed fix

Simple one-liner
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #671123 - Flags: review?(mbanner)

Comment 15

5 years ago
I would ideally like to see it search in the order of display. E.g., could be by 'from' from z to a, assuming you'd clicked the 'from' header once or twice effect that order. Then you would not need a separate option. In the short run, I'd settle for just searching in date order from newest to oldest.

Comment 16

5 years ago
Mark raises a good point -- Magnus: can you make the call to [Reverse]EnumerateMessages follow the users ordering....?

might be a bit of complexity if the user's sort order isn't by date?
(Assignee)

Comment 17

5 years ago
Yes that would be more complex, and the use cases for it are not that many - then you'd need to know e.g. who it's from and that that who happens to be in a suitable place in the alphabet. And for date we shouldn't do it anyway, since you might very well want to sort the messages in one order, but in most cases what's newest is more important.
Comment on attachment 671123 [details] [diff] [review]
proposed fix

Ok, I don't see any issues with this. r=me.
Attachment #671123 - Flags: review?(mbanner) → review+
(Assignee)

Comment 19

5 years ago
http://hg.mozilla.org/comm-central/rev/ed60a8f558aa -> FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 19.0
(Assignee)

Updated

5 years ago
Component: Folder and Message Lists → Search
(Assignee)

Comment 20

5 years ago
Backed out since this seems to have caused some oranges -- https://tbpl.mozilla.org/php/getParsedLog.php?id=16737186&tree=Thunderbird-Trunk

http://hg.mozilla.org/comm-central/rev/f0a1dc6af47c
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 21

5 years ago
Also to check - https://tbpl.mozilla.org/php/getParsedLog.php?id=16736733&tree=Thunderbird-Trunk&full=1
(Assignee)

Comment 22

4 years ago
(In reply to Magnus Melin from comment #21)
> Also to check -
> https://tbpl.mozilla.org/php/getParsedLog.php?id=16736733&tree=Thunderbird-
> Trunk&full=1

This one wasn't related, went away before the backout.
(Assignee)

Comment 23

4 years ago
The test failure is always reproducible, but i don't think i see a real world bug (though the refresh isn't doable the same way from the ui afaik). The failure is here: http://mxr.mozilla.org/comm-central/source/mail/base/test/unit/test_viewWrapper_virtualFolder.js#350

Andrew, any idea about this?
Flags: needinfo?(bugmail)
(In reply to Magnus Melin from comment #23)
> Andrew, any idea about this?

I accuse the reverse enumerator of stopping prematurely, skipping the first header in the box, but the quick perusal I did of the code in question was not enough to make it obvious where the glitch is.  I would suggest looking into the enumerator more.
Flags: needinfo?(bugmail)
(Assignee)

Comment 25

4 years ago
Created attachment 724560 [details] [diff] [review]
proposed fix, v2

Try looks happy with this (except for the usual oranges) - https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=cf1e60fd4c8a
Attachment #671123 - Attachment is obsolete: true
Attachment #724560 - Flags: review?(asuther)
Comment on attachment 724560 [details] [diff] [review]
proposed fix, v2

I'm pretty It's :asuth that you wanted as a reviewer - switching.
Attachment #724560 - Flags: review?(asuther) → review?(bugmail)
(Assignee)

Comment 27

4 years ago
Thx, must have misclicked.

Comment 28

4 years ago
Any chance that :asuth might look see in on this ?
(Assignee)

Comment 29

4 years ago
Andrew? ping
Comment on attachment 724560 [details] [diff] [review]
proposed fix, v2

r=asuth, tremendously sorry about the delay.
Attachment #724560 - Flags: review?(bugmail) → review+
(Assignee)

Comment 31

4 years ago
https://hg.mozilla.org/comm-central/rev/d195627d5482 -> FIXED
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: Thunderbird 19.0 → Thunderbird 24.0

Comment 32

4 years ago
Out of curiosity, Magnus, when is v24.0 actually scheduled...?  My up-to-date version is only at 17.0.6, now....

(Or: Is there a reason why such fixes aren't merely inserted into the next release, say, 17.0.7 ?)

I ask, because this patch could be immediately useful.

Comment 33

4 years ago
(In reply to john ruskin from comment #32)
.... say, 17.0.7 ?)

Or to any next available version, before 24, before 3 months from now?  My vote would be to proffer it to the next release.   

I plead ignorance about how the versioning system works, schedules, and etc., and the system for choosing the version into which a patch is placed.
(Assignee)

Comment 34

4 years ago
It's available in nightly builds already if you're in a hurry and willing to accept some rough edges. The next non-developer version is tb24, which will be released in september - https://wiki.mozilla.org/Releases#Next_Thunderbird_Major_Release

These kind of fixes aren't backported to the stable branch (tb 17), as patches can always cause unwanted side effects nobody thought they would.

Updated

4 years ago
Duplicate of this bug: 886122
You need to log in before you can comment on or make changes to this bug.