Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

ContainmentMode.ExactPhrase in EWS Managed API

$
0
0

Hi all, I'm using EWS Managed API to find messages by filtering their subjects using a search expression. I'm creating a SearchFilter.ContainsSubstring object but trying to understand the ContainmentMode property.

Lets say my subject is "My support case". I would like that if my search is for the word "support" then it finds this message, and if it's for "port" then it doesn't - ie, a word-based search (honouring space or start/end of string as a word delimiter).

Looking at the available options for the ContainmentMode property, I see 'SubString' and 'ExactPhrase' look like suitable candidates, but in experimentation they seem to return identical results - they both behave how I would expect SubString to behave. If I set ContainmentMode to ExactPhrase and search for "support" then the message is found, but also if I search for "port" or "y sup" or any other substring.

Can you tell me what is the difference between SubString and ExactPhrase, and if there's a way to search for a distinct word (not a subset of a word, nor a prefix of one), If I put spaces around the word I'm looking for it won't find one at the beginning or end of the subject.

Thanks,

Oliver


Viewing all articles
Browse latest Browse all 7132

Trending Articles