09-16-2013 09:22 PM
I'm using EV search api to search emails. However, I can only search the mails from system folders such as "Inbox", "Sent Items", etc. Our customer created custom folders such as inbox/firm, inbox/helpdesk. I cannot search the mails under those custom folders. Any idea?
This is how I get my achives:
IArchives archivesRead = (IArchives)cmAPI.Archives;
archivesRead.Computer = "192.168.24.26";
archivesRead.Permissions = EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
archivesRead.ArchiveTypes = (int)EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_MAILBOX;
archivesRead.Get();
This is how I use the search api:
ISearchQuery2 query = (ISearchQuery2)new SearchQuery();
IIndexSearch2 search = (IIndexSearch2)new IndexSearch2();
search.SelectArchive(archiveId);
query.AddTerm("rtea", "xx@dd.com", 0);
//query.AddOp((int)ESearchQueryOperators.ESQand, (int)ESearchOperatorScope.ESQdefault);
ISearchResults2 results = (ISearchResults2)search.Search(query.Query, 1, 10000, "");
09-16-2013 11:58 PM
Do you have emails archived in those custom folders? And are they indexed properly?
It could be realted to IIndexSearch2 :: HasFolders
This property indicates whether the currently selected archive contains a folder structure.
search.SelectArchive("ArchiveID");
//do something
if (search.HasFolders == true)
{
//do something
09-17-2013 12:14 AM
Yes. There're several emails in those custom folders. And when I select one of these emails in Outlook, there's a status bar float on the top of message body says it has been archived.
I haven't tried HasFolders. Will let you know the result later. Thanks.
09-22-2013 12:06 AM