-
Notifications
You must be signed in to change notification settings - Fork 164
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
Make cypht search shows latest results when searching in a mail box #765
Make cypht search shows latest results when searching in a mail box #765
Conversation
Shouldn't we sort by the default field user is seeing messages sorted? Might be internal date, might be date of arrival. |
@@ -1090,7 +1090,13 @@ public function search($target='ALL', $uids=false, $terms=array(), $esearch=arra | |||
if ($esearch_enabled) { | |||
$res = $esearch_res; | |||
} | |||
return $this->cache_return_val($res, $cache_command); | |||
$found_messages_uids = $this->cache_return_val($res, $cache_command); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that we get all search results here? If they are paginated, sorting won't work afterwards.
Also, isn't there an IMAP command to search AND sort in one go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that we get all search results here? If they are paginated, sorting won't work afterwards. Also, isn't there an IMAP command to search AND sort in one go?
According to my researches, yes: we get all of them, since the IMAP response ($status
) is "OK" there.
Pagination is being processed when formatting as I observed.
Search and sort in one go with IMAP command: I'll look into this possibility and share my findings, so that you can advise.
I have found that internal_date and date are the same. The goal here were to make sure by default newers messages are on top. I am still working on this PR to make sure that sort follows users choices / preferences (Ascending or Descending). |
There are certainly 2 different dates that user can choose for default sort order in imap module - Date of the msg (date sent) and date of arrival (which is probably the internal date). I think we should be in sync here with the setting. |
@mmarcwabo Please take this over the finish line :-) |
Just adding my 2¢, Cypht might have an opportunity to do truly smart searches... by doing a "relevance" search and sorting with the most relevant results at the top. I haven't yet used Cypht in the real world, so this is just a thought off the top of my head. |
ok, let's track here: #959 |
Closing this in favor of #1120 - turns out we needed both front and backend fixes to make sorting work in imap folders. |
Pullrequest
Make cypht search show latest results
Make default sort mode on search by internal date from the newest to the latest
Issues
Checklist
How2Test
Todo