-
Notifications
You must be signed in to change notification settings - Fork 9
EWS: PoC of searching messages on the server #906
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
base: master
Are you sure you want to change the base?
Conversation
|
Looking into searching with OWA, I discovered that it uses a FindItem request to search for deleted contacts. I was eventually able to adapt this request into a request to search messages for starred, unread or keywords. |
|
Having tried to directly search contact fields in #901, I realised that for messages I was actually getting a case-insensitive search even though I had not specified in the query, so I've updated the queries to specify case-insensitive searching just in case it makes a difference. |
205652e to
44ad6a4
Compare
| to.emailAddress?.toLowerCase().includes(searchTerm)) || | ||
| msg.text?.toLowerCase().includes(searchTerm)) | ||
| ) as ArrayColl<EMail>; | ||
| searchMessages = await folder.searchMessages(isShowStarred, isShowUnread, searchTerm); |
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.
This is quick search. It's searching only the displayed emails and therefore extremely fast. It matches the Thunderbird quick search.
The API to implement is SearchEMail. This is searches the entire DB. Now it should also search the server. Please implement that API.
I understand that Exchange can search only 1 folder at a time. We need to discuss how to deal with that.
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.
I wanted to try it out on a search query that I knew I would be able to code so I implemented it for tags but unfortunately it turns out that the tags pane doesn't work at all for some reason.
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.
The tags bug was actually FastList's fault for not showing me the tagged messages. Filed PR #910.
|
Added commit 538a38d to demonstrate global server-side search. When no folder is specified, we pass the list of folders to Exchange which then gives us an array of results as if we had searched each folder separately, and we then combine the results at the end. |
7d2a658 to
3640c13
Compare
This is implemented only for the per-folder search at the bottom of the message list because Exchange does not support deep search traversal.
This is implemented only for EWS, because:
FindItemfor searching, so as yet I don't even know whether you can specify search terms. Instead it uses its own free-text based search. For Office 365 you can at least search for unread messages (this works by appendingisRead:falseto the search keyword).