AquaMail Forum

English - Android => General Discussion => Topic started by: jcasares on September 15, 2013, 03:00:46 am

Title: Search
Post by: jcasares on September 15, 2013, 03:00:46 am
I started to use search frequently and for me it's not clear what it does. When I search at the accounts level I get a "Search all loaded". Isn't this supposed to also use IMAP server search? Maybe a better wording should be used.

It would also be wonderful to be able to clear the history because if not you have a lot of junk there (like wrongly tipped words).
Title: Re: Search
Post by: Kostya Vasilyev on September 20, 2013, 02:08:23 am
Searching from the "main windows" searches through all loaded messages.

For IMAP server search, please initiate search from the respective folder.
Title: Re: Search
Post by: jcasares on September 20, 2013, 02:49:07 am
But if I want to search in all IMAP folders?
Not possible?
Title: Re: Search
Post by: Kostya Vasilyev on September 20, 2013, 02:52:14 am
IMAP search works one folder at a time.
Title: Re: Search
Post by: Squee on October 05, 2013, 05:31:17 pm
Dear Kostya,
Are there any plans on the longterm to implement a search in all IMAP folders? (your list of feature request must be enormous. But that is what happens if you make such a great app :-) Most of the time, if I search for a specific email, I just can't remember in which (sub)-folder I moved the message.
Kind regards,
Squee
Title: Re: Search
Post by: horizon on October 08, 2013, 08:46:23 pm
Dear Kostya,
Are there any plans on the longterm to implement a search in all IMAP folders? (your list of feature request must be enormous. But that is what happens if you make such a great app :-) Most of the time, if I search for a specific email, I just can't remember in which (sub)-folder I moved the message.
Kind regards,
Squee

I agree with above, although I remember most of the time which folder it is in. At least if we can search through e-mails that were received and filed on the device  that would also help, eventually it could build a larger index that can enable searching more folders.
Title: Re: Search
Post by: beaky on October 09, 2013, 01:16:09 am
I appreciate kostya is not accountable for how IMAP servers carry out a search, but I recently had an odd problem when searching in my main ( highest traffic) account.
I was searching for an email that numerically was about midway between oldest and newest. When I started a search in aquamail that should have returned about 6-8 results, the search eventually seemed to be finished without the sought one. It was on the server, as I searched it using thunderbird and found it, it was the last one found. Then, I revised the search on aquamail so it only returned a single result. It was found. The original search - one that worked on Thunderbird, still did not work from aquamail.
All I can think of is a timeout of some kind.
I have just short of 20000 emails in my main account inbox.
Any ideas?

Title: Re: Search
Post by: Kostya Vasilyev on October 16, 2013, 02:03:28 am
@beaky - it's possible there is a bug in my search code somewhere (stranger things have happened), but I can't be specific or investigate without a debug log.
Title: Re: Search
Post by: beaky on October 16, 2013, 04:05:34 am
@beaky - it's possible there is a bug in my search code somewhere (stranger things have happened), but I can't be specific or investigate without a debug log.
Is there a way I can create one (assuming problem is still repeatable)?
Mind you, as the sought for item was an important username/password I hope you don't mind if I leave this until I can change this first...... :-)
Title: Re: Search
Post by: Kostya Vasilyev on October 28, 2013, 02:06:10 am
Sure, take your time... Or just check the log for "reporting error" and give me the portion above, some IMAP commands and presumably a stack trace...
Title: Re: Search
Post by: alexk on January 30, 2014, 08:34:00 am
Any news from the investigation?

I have a slightly different problem at hand: my local search sometimes finds fewer matches than my server search (both from AquaMail). I have verified using web mail that an extra hit is legitimate (can see the match), and I checked that AquaMail has the message in question loaded. This is a really small account of less than 500 messages across all folders (I am test-driving the application and *love it!*).

I have to agree with the earlier posters that being able to clear search history and run server searches across folders (with AquaMail combining multiple IMAP-returned lists) would be very useful features to have... if you get some time :-)
Title: Re: Search
Post by: Kostya Vasilyev on February 04, 2014, 06:39:06 pm
Yes, it's possible that a local search's results may be different from those returned by server side search. The results are automatically combined, and server results are always included (the server "having a final say" on matches).
Title: Re: Search
Post by: alexk on February 05, 2014, 05:26:55 am
I am not quite following you. How can combing local and server search results explain a local search returning fewer hits? Would you please elaborate.

P.S. I have found the right place to clear search history from app settings - no longer a question/issue.

Thank you!
Title: Re: Search
Post by: beaky on February 05, 2014, 05:33:37 pm
I have another search issue.
In an earlier thread I spoke of occasionally not finding a result that was actually there, on a server search. I did not pursue as I could always find with Thunderbird on the PC, and it seemed rare anyway.
Today, on a good connection but not my own, I hit a different issue. Searching a folder with 22000 emails, it goes initially fairly fast, slows with each new batch searched (the message says "searching nnn/22000" and nnn increments in steps), it takes longer, and then longer, finally exiting with "network connection problem" or similar, after searching about 5 to 8% of the total.
My email server is on 1und1.de and is IMAP.
Title: Re: Search
Post by: Kostya Vasilyev on February 09, 2014, 11:27:10 pm
My IMAP search code works in batches, trying to avoid overloading the server with asking for every matching message up front (which there could be a lot of).

Think of iterating an array, using an index.

On the other hand, sounds like 1und1's IMAP server somehow manages to get slower and slower as the search window gets further down the list.

( A Gmail folder with 88000 messages is equally fast when searching near the top vs. near the bottom of the list... just another data point... )
Title: Re: Search
Post by: beaky on February 27, 2014, 06:09:34 am
My IMAP search code works in batches, trying to avoid overloading the server with asking for every matching message up front (which there could be a lot of).

Think of iterating an array, using an index.

On the other hand, sounds like 1und1's IMAP server somehow manages to get slower and slower as the search window gets further down the list.

( A Gmail folder with 88000 messages is equally fast when searching near the top vs. near the bottom of the list... just another data point... )
I will try this again on my own connection.
Does the search ask the server for "the first/next 25 matches", or all the matches in the first/next nnn messages? It looks like the second of these cases.
If the first, then it could get slower if matching items happen to be more sparse going back in time. It does not account for it stopping, but that might relate to the connection I was using.
Title: Re: Search
Post by: Kostya Vasilyev on March 03, 2014, 01:56:24 am
Unfortunately, the IMAP command that works like "give me N more matches" is only available with an extension, and one that's pretty rare in the real world.

So the code iterates through the mailbox's entire message range, and asks for "any matches within this range of messages".

Even so, the commands that return no matches should complete pretty quickly (unless you're on a very high latency mobile connection, for example), and you should be seeing the app's search progress update (bottom of the list).

As usual, I'm open to debug logs.