Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EWS - combine query string with search filter object

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?

like image 747
Ed Avis Avatar asked Feb 01 '13 15:02

Ed Avis


1 Answers

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.

like image 181
Ed Avis Avatar answered Jan 04 '23 06:01

Ed Avis