none
EWS Managed Api: Searchfilter the question. RRS feed

  • Question

  • searchfolder, searchfilter was created using the search function.
    But there's trouble.
    Search body only when type = text of search.
    bodytype = html does not search.


    I use the source

    List<SearchFilter> searchFilterCollection = new List<SearchFilter>();
    searchFilterCollection.Add(new SearchFilter.ContainsSubstring(PR_BODY, Body));
    .
    .
    .
    Another of searchfilter

    SearchFilter.SearchFilterCollection collfilter1 = new SearchFilter.SearchFilterCollection(LogicalOperator.Or, searchFilterCollection.ToArray());
    Filter = collfilter1;
                        searchFolder.SearchParameters.RootFolderIds.Add(searchfolderid);
                        searchFolder.SearchParameters.Traversal = SearchFolderTraversal.Shallow;
                        searchFolder.SearchParameters.SearchFilter = Filter;
                        searchFolder.DisplayName = "test";
                        searchFolder.Save(WellKnownFolderName.SearchFolders);
                        FindItemsResults<Item> findResults = searchFolder.FindItems(view);

    There is another question.

    To AQS Is there a way to search subfolders?

    inbox
    └─ a
    └─ b
    └─ c

    inbox, a, b, c, and I want to search.

    Please tell us how to solve.


    Wednesday, August 14, 2013 2:00 AM

Answers

All replies

  • If your using the PR_Body property http://msdn.microsoft.com/en-us/library/ee159410(v=exchg.80).aspx than that's what you would expect as all the search filter is going to do is scan the data in that property and that property contains the Text Body Part. I would suggest you try the Strongly type property instead http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.itemschema.body(v=exchg.80).aspx.

    If you want to search subfolders of the Inbox use a FindFolders operation on the Inbox to get the subfolders and then search each Subfolder. In 2010 you can only search one folder per operation so you will need a single operation per folder, if your using 2013 look at using eDiscovery and KQL which can do a whole mailbox in one op.

    Cheers
    Glen

    Wednesday, August 14, 2013 6:23 AM
  • Thank you.

    Glen

    I used to ItemSchema.Body. But htmltype body not searched.

    I was wrong questions.

    Answer I want,

    When you search for "A". May come to search the Body of all associated with the 'A'.

    Can be obtained using the answer "finditems(folderid,AQS,view)" but you will not be able to find the subfolder.

     

     

     

    do you get information about eDiscovery?




    Friday, August 16, 2013 1:28 AM
  • If you want to search the HTMLBody only then use PidTagHtml http://msdn.microsoft.com/en-us/library/office/cc842395.aspx property

    The actually text should be the same between the two the only thing extra you'll get is the HTML Mark-up.

    >> Can be obtained using the answer "finditems(folderid,AQS,view)" but you will not be able to find the subfolder.

    Not sure what you mean by this but as I said findItems operates in the context of a folder. So if you want to Search the Inbox and all the Subfolders of the Inbox then you will need a separate Search for Every folder, (or create a Searchfolder that covers these folders and search that).

    eDiscovery is only available on 2013 see http://technet.microsoft.com/en-us/library/dd298021(v=exchg.150).aspx

    Cheers
    Glen

    Friday, August 16, 2013 4:00 AM