使用搜索文件夹时搜索正文字段

时间:2016-06-07 18:48:25

标签: exchangewebservices

下面的查询在搜索文件夹中搜索。该查询应该与主题或正文相匹配。它适用于主题字段(以及我测试过的其他字段),但它不适用于正文字段。

没有错误消息。它根本找不到任何带有“测试”字体的电子邮件。

当我搜索收件箱而不是我创建的搜索文件夹时,查询适用于所有字段。

使用搜索文件夹时如何搜索正文字段?

  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
      <t:RequestServerVersion Version="Exchange2013_SP1" />
    </soap:Header>
    <soap:Body>
      <m:FindItem Traversal="Shallow">
        <m:ItemShape>
          <t:BaseShape>AllProperties</t:BaseShape>
          <t:BodyType>Best</t:BodyType>
        </m:ItemShape>
        <m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beginning" />
        <m:Restriction>
        <t:Or>  
           <t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
             <t:FieldURI FieldURI="item:Subject" />
             <t:Constant Value="test" />
           </t:Contains>
           <t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
             <t:FieldURI FieldURI="item:Body" />
             <t:Constant Value="test" />
           </t:Contains>
        </t:Or>  
        </m:Restriction>
        <m:ParentFolderIds>
          <t:FolderId Id="AQMkADAwATM3ZmYAZS1lOTAwAC0wMAA1ZS0wMAItMDAKAC4AAAPiAHaCXAJHRJ3V9VdvY0KtAQAj99d213jITaEDW4/40fguAAAAHOYgfgAAAA==" />  // root
        </m:ParentFolderIds>
      </m:FindItem>
    </soap:Body>
  </soap:Envelope>

1 个答案:

答案 0 :(得分:1)

我在内部跟踪了我们的搜索人员。不幸的是,身体财产不是一个可搜索的财产。执行<Restriction>对身体无效。

Exchange确实使用正文(连同主题和附件内容)来创建一个“词袋”,当您使用查询字符串时,它可以搜索到它。因此,例如,如果您使用Outlook或OWA中的搜索框并输入“foo”,如果foo位于消息正文中,则它将包含在结果中。