Results 1 to 7 of 7

Thread: Grammar for Search Query

  1. #1
    Join Date
    Jul 2007
    Posts
    27
    Rep Power
    8

    Default Grammar for Search Query

    Greetings,

    I am planning to write some code for a Zimlet which will search specific fields in an Appointment. For this I need to understand the Grammar of the element <query></query> in the Search request.

    I have downloaded the source of Zimbra 4.5.6, but I could not find the Grammar file which is used by the Zimbra Server to parse the search queries. As far as I understand Zimbra uses Java CC parser to read the Grammar files and generate the Code.
    Please let me know if my understanding is incorrect.


    I would like to know if these Grammar files are also shipped with the Zimbra 4.5.6 Open Source edition? If it is shipped please let me know where could I find the Grammar file for the Search queries?

    Any help in this regard will be greatly appreciated.
    Regards,
    Zocs...

  2. #2
    Join Date
    Sep 2005
    Location
    Sunnyvale, CA
    Posts
    269
    Rep Power
    10

    Default

    Not really sure what you mean by grammar, but the SOAP API is spelled out here:

    ZimbraServer/docs/soap.txt
    ZimbraServer/docs/soap-calendar.txt

    Among other useful information..


    HTH.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    Join Date
    Jul 2007
    Posts
    27
    Rep Power
    8

    Default Grammar for Search Query

    Greetings,

    Thanks for your inputs.

    By Grammar I mean the the Language and Grammar which is generally used to generate parsers. When a users fires a search request to the Zimbra Server it contains an element <query> which contains the query user has fired. This query is parsed on the Zimbra Server side by a parser which is generated by Java CC (A Parser generation tool in java) found at https://javacc.dev.java.net/
    This tool needs a Language and Grammar to generate a parser as it is with other classical tools like Yacc (mostly used with lex-another tool).

    To be specific I would like to know the Grammar for query element in following code
    Code:
    <soap:Body><SearchRequest xmlns="urn:zimbraMail"
    
     offset="0" limit="25" types="message,contact,appointment,wiki,document"><tz id="(GMT+05.30) Chennai
    
     / Kolkata / Mumbai / New Delhi"/><locale>en-US</locale>
    <query>((from:(swapnil)) OR (from:(ajay))) in:inbox larger:2kb</query>
    </SearchRequest></soap
    
    :Body>
    Above mentioned search criteria is just an example and there are other various complex scenario's possible for the search criteria in <query></query> node.
    Regards,
    Zocs...

  4. #4
    Join Date
    Jul 2007
    Posts
    27
    Rep Power
    8

    Default

    By the way, i found explanation of the individual items in search query at the following Zimbra Wiki page. It explains the Grammar but it in itself does not have the Grammar file used to generate the parser.

    Search Tips - Zimbra :: Wiki


    thanks.
    Regards,
    Zocs...

  5. #5
    Join Date
    Jul 2007
    Posts
    27
    Rep Power
    8

    Default

    Does Zimra ship the Grammar and Language files in Open Source edition?
    If yes where could I find it? I am using 4.5.6 Open source edition.
    Regards,
    Zocs...

  6. #6
    Join Date
    Sep 2005
    Posts
    55
    Rep Power
    10

    Default

    Take a look at ZimbraServer/docs/query.txt

    -Conrad
    Bugzilla - Wiki - Downloads - Before posting... Search!

  7. #7
    Join Date
    Jul 2007
    Posts
    27
    Rep Power
    8

    Default

    Thanks cdamon for the reply.
    Actually I have read the mentioned document and also the link mentioned at Search Tips - Zimbra :: Wiki

    I am looking for the exact grammar file used as input to the Java CC tool, to generate the parser.

    Actually I am developing a zimlet to which the complex search query will be passed and I need to parse this search query. So if i have the exact grammar files it would help me to code better the parser which will parse the search query, as i will consider all the use-case scenarios in a better way.
    Regards,
    Zocs...

Similar Threads

  1. Change the default mail sync query to a phone
    By phingers in forum Zimbra Mobile
    Replies: 1
    Last Post: 07-31-2007, 08:46 PM
  2. REST query should work, but doesn't
    By DrXero in forum Developers
    Replies: 4
    Last Post: 06-11-2007, 04:15 PM
  3. sql query to retrieve mails store path
    By banou in forum Developers
    Replies: 10
    Last Post: 05-02-2007, 06:53 AM
  4. Lotus migration
    By babou in forum Migration
    Replies: 15
    Last Post: 03-05-2007, 09:33 PM
  5. query data changes on server through SOAP
    By JackyQiu in forum Developers
    Replies: 1
    Last Post: 05-17-2006, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •