Microsoft EAS: Implementing Search Request with GreaterThan elment

I am trying to hit a eas search request with greater-than element inside the AND element.When i use free-text element i am getting the response properly but when i add the greater-than element its throwing Status 2 error (Invalid request). I have pasted my request below just check and say whether i made any mistake .

Thanks in advance 

Serializer s = new Serializer();
    s.start(Tags.SEARCH_SEARCH).start(Tags.SEARCH_STORE);
    s.data(Tags.SEARCH_NAME, "Mailbox");
    s.start(Tags.SEARCH_QUERY).start(Tags.SEARCH_AND);
    s.data(Tags.SYNC_CLASS, "Email");
    s.data(Tags.SYNC_COLLECTION_ID,folderId);
    s.data(Tags.SEARCH_FREE_TEXT, "subject:("+att_Subject+")from:("+att_From+")to:("+att_To+")Attachments:("+att_Filename+")has:attachment");
    s.start(Tags.SEARCH_GREATER_THAN);
    s.start(Tags.EMAIL_DATE_RECEIVED);
    s.data(Tags.SEARCH_VALUE, "2013-06-21T01:12:23Z");
    s.end();
    s.end();//Received
    s.end().end();              // SEARCH_AND, SEARCH_QUERY
    s.start(Tags.SEARCH_OPTIONS);
    if (offset == 0) {
        s.tag(Tags.SEARCH_REBUILD_RESULTS);
    }
    if (mIncludeChildren) {
        s.tag(Tags.SEARCH_DEEP_TRAVERSAL);
    }
    // Range is sent in the form first-last (e.g. 0-9)
    //s.data(Tags.SEARCH_RANGE,"0-0");
    s.start(Tags.BASE_BODY_PREFERENCE);
    s.data(Tags.BASE_TYPE,"2");
    s.data(Tags.BASE_TRUNCATION_SIZE, "20000");
    s.end();                    
    s.end().end().end().done(); 
When i take out the underlined part from this request , iam getting the response properly.. 


July 21st, 2013 11:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics