Project

General

Profile

Support for quering messages or collections by part of body of message

Description

This feature allows user to query for messages or collections containing messages which in body of a message contained text passed by user.

To execute request in which user wants to find messages with "test failed" string XMPP client needs to add following element

<query xmlns="http://tigase.org/protocol/archive#query">
    <contains>test failed</contains>
</query>

as child element of retrieve or list element of request.

Example query requests

  1. Retrieving messages with "test failed" string with user juliet@capulet.com between 2014-01-01 00:00:00 and 2014-05-01 00:00:00
    <iq type="get" id="query2">
        <retrieve xmlns='urn:xmpp:archive'
            with='juliet@capulet.com'
            from='2014-01-01T00:00:00Z'
            end='2014-05-01T00:00:00Z'>
              <query xmlns="http://tigase.org/protocol/archive#query">
                  <contains>test failed</contains>
              </query>
        </retrieve>
    </iq>
    
  2. Retrieving collections containing messages with "test failed" string with user juliet@capulet.com between 2014-01-01 00:00:00 and 2014-05-01 00:00:00
    <iq type="get" id="query2">
        <list xmlns='urn:xmpp:archive'
            with='juliet@capulet.com'
            from='2014-01-01T00:00:00Z'
            end='2014-05-01T00:00:00Z'>
              <query xmlns="http://tigase.org/protocol/archive#query">
                  <contains>test failed</contains>
              </query>
        </list>
    </iq>
    
Included in documentation