Indexed Search With MAPI and Exchange

In Outlook 2013, we took a change to improve how we build search folders when searching against Exchange 2010 and higher for text we’d expect to find in commonly indexed fields. Prior to this change, we’d build a search folder restriction that looks like this:

PR_SUBJECT contains 'text' || PR_BODY contains 'text' || PR_SENDER_NAME contains ‘text' || ...

If you use Outlook 2013 and create an online search folder (say, by just doing a search), then look in MFCMAPI, you’ll find the search criteria is greatly simplified:

0x0eaf001f contains ‘text’

Development has allowed me to document this property:

 #define PR_SEARCH_ALL_INDEXED_PROPS_W PROP_TAG(PT_UNICODE, 0x0EAF)

Use of this property in building your searches has a few benefits:

  • Your restriction is greatly simplified
  • The Exchange server can better understand the intent of the search and use this to better optimize it.
  • As new properties are indexed on the server side, the utility of your searches increases without rewriting client code.

This property will work against Exchange 2010 and higher.