The Exchange Web Services FindItems()
call has some overloads taking a SearchFilter
object and others taking a query string in Advanced Query Syntax (AQS). Currently I accept AQS queries, such as "subject:Foo OR subject:Bar", from callers to my code and pass them on to EWS.
But now I would like to do some filtering using a SearchFilter
too, to restrict by date range. Although it is possible to do that in AQS syntax as "date:>11/05/04", I feel it is cleaner to specify the filter programmatically:
new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, d);
So what I'd like to do is query by both a SearchFilter
and a query string. To do that I would like to convert the query string I've received into a SearchFilter
object so I can then 'and' it together with my own filtering.
Is there a way to construct a SearchFilter
on the client given an AQS query string?
Partially answering my own question: I suspect this is not possible because EWS does not support query strings on public folders, but it does support SearchFilter
objects on public folders. Therefore, a SearchFilter
cannot offer the functionality of query strings, unless this EWS restriction is just pointless.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With