(EWS) Search mail by body Issue in SearchFolder using Searchfilter

hs cho 21 Reputation points
2021-07-08T07:37:34.293+00:00

Hi,
I'm currently developing mail search function using EWS. (ver 2.2.1.2, Exchange 2016)
But It didn't work well using SearchFolder.

I made SearchFolder for Searching mail in subfolders.

But 'ItemSchema.Body' Searchfilter doesn't work well in Searchfolder.
It did work in one root folder, not in SearchFolder(include subfolders).

and Searching mail by subject, recipients etc..did work well in SearchFolder. only body filter get nothing in Search result.

I think It caused as Exchange Server does not get body property When making Searchfolder by performance issue.

If that so, How can I get 'body' property when I making Searchfolder?
and if it is impossible, Is there other way to Search mail by body in folder including subfolders?

I already checked that I can not use AQS in SearchFolder. also I cannot use Traversal Deep option which retrive subfolders in ordinary Searchfilter.

Is there any advise?
Thank you.

Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
341 questions
No comments
{count} votes

Accepted answer
  1. Glen Scales 3,981 Reputation points MVP
    2021-07-12T00:20:13.9+00:00

    But 'ItemSchema.Body' Searchfilter doesn't work well in Searchfolder.

    SearchFilter on the Body are very expensive in performance terms, searchfolder generally back-fill so it maybe after a period of time you search folder will work but it depends on the complexity of the search your trying to do.

    I already checked that I can not use AQS in SearchFolder. also I cannot use Traversal Deep option which retrive subfolders in ordinary Searchfilter.

    Instead of using a SearchFolder why not just make a live query using AQS as this uses the content indexes these query will generally return in an acceptable amount of time.

0 additional answers

Sort by: Most helpful