Abstract: | This specification provides canonical documentation of the 'jabber:iq:search' namespace currently in use within the Jabber community. |
Author: | Peter Saint-Andre |
Copyright: | © 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Active |
Type: | Historical |
Version: | 1.2 |
Last Updated: | 2004-03-22 |
NOTICE: This Historical specification provides canonical documentation of a protocol that is in use within the Jabber/XMPP community. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it may be converted to standards-track in the future or may be obsoleted by a more modern protocol.
1. Introduction
2. Use Cases
2.1. Searching
3. Extensibility
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
6.1. Protocol Namespaces
6.2. Field Standardization
7. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
This specification documents a protocol currently used to search information repositories on the Jabber network. To date, the jabber:iq:search protocol has been used mainly to search for people who have registered with user directories (e.g., the "Jabber User Directory" hosted at users.jabber.org). However, the jabber:iq:search protocol is not limited to user directories, and could be used to search other Jabber information repositories (such as chatroom directories) or even to provide a Jabber interface to conventional search engines.
The basic functionality is to query an information repository regarding the possible search fields, to send a search query, and to receive search results. Note well that there is currently no mechanism for paging through results or limiting the number of "hits", and that the allowable search fields are limited to those defined in the XML schema; however, extensibility MAY be provided via the Data Forms [1] protocol, as described below.
In order to search an information respository, a user first needs to discover what search fields are supported by the service:
<iq type='get' from='romeo@montague.net/home' to='characters.shakespeare.lit' id='search1' xml:lang='en'> <query xmlns='jabber:iq:search'/> </iq>
The service MUST then return the possible search fields to the user, and MAY include instructions:
<iq type='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search1' xml:lang='en'> <query xmlns='jabber:iq:search'> <instructions> Fill in one or more fields to search for any matching Jabber users. </instructions> <first/> <last/> <nick/> <email/> </query> </iq>
The user MAY then submit a search request, specifying values for any desired fields:
<iq type='set' from='romeo@montague.net/home' to='characters.shakespeare.lit' id='search2' xml:lang='en'> <query xmlns='jabber:iq:search'> <last>Capulet</last> </query> </iq>
The service SHOULD then return a list of search results that match the values provided:
<iq type='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search2' xml:lang='en'> <query xmlns='jabber:iq:search'> <item jid='juliet@capulet.com'> <first>Juliet</first> <last>Capulet</last> <nick>JuliC</nick> <email>juliet@shakespeare.lit</email> </item> <item jid='tybalt@shakespeare.lit'> <first>Tybalt</first> <last>Capulet</last> <nick>ty</nick> <email>tybalt@shakespeare.lit</email> </item> </query> </iq>
If there are no matching directory entries, the service MUST return an empty <query/> element:
<iq type='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search2' xml:lang='en'> <query xmlns='jabber:iq:search'/> </iq>
The fields defined in the 'jabber:iq:search' namespace are strictly limited to those specified in the schema. If a host needs to gather additional information, Data Forms SHOULD be used; a host MUST NOT add new fields to the 'jabber:iq:search' namespace. Support for extensibility via Data Forms is RECOMMENDED, but is not required for compliance with this document.
The extensibility mechanism for searching makes use of a hidden FORM_TYPE field for the purpose of standardizing field names within the form, as defined in Field Standardization for Data Forms [2]. Implementations supporting this extensibility mechanism SHOULD support field standardization as well.
<iq type='get' from='juliet@capulet.com/balcony' to='characters.shakespeare.lit' id='search3' xml:lang='en'> <query xmlns='jabber:iq:search'/> </iq>
<iq type='result' from='characters.shakespeare.lit' to='juliet@capulet.com/balcony' id='search3' xml:lang='en'> <query xmlns='jabber:iq:search'> <instructions> Use the enclosed form to search. If your Jabber client does not support Data Forms, visit http://shakespeare.lit/ </instructions> <x xmlns='jabber:x:data' type='form'> <title>User Directory Search</title> <instructions> Please provide the following information to search for Shakespearean characters. </instructions> <field type='hidden' var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <field type='text-single' label='Given Name' var='first'/> <field type='text-single' label='Family Name' var='last'/> <field type='list-single' label='Gender' var='x-gender'> <option label='Male'><value>male</value></option> <option label='Female'><value>female</value></option> </field> </x> </query> </iq>
<iq type='set' from='juliet@capulet.com/balcony' to='characters.shakespeare.lit' id='search4' xml:lang='en'> <query xmlns='jabber:iq:search'> <x xmlns='jabber:x:data' type='submit'> <field type='hidden' var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <field var='x-gender'> <value>male</value> </field> </x> </query> </iq>
<iq type='result' from='characters.shakespeare.lit' to='juliet@capulet.com/balcony' id='search4' xml:lang='en'> <query xmlns='jabber:iq:search'> <x xmlns='jabber:x:data' type='result'> <field type='hidden' var='FORM_TYPE'> <value>jabber:iq:search</value> </field> <reported> <field var='first' label='First Name' type='text-single'/> <field var='last' label='Last Name' type='text-single'/> <field var='jid' label='Jabber ID' type='jid-single'/> <field var='x-gender' label='Gender' type='list-single'/> </reported> <item> <field var='first'><value>Benvolio</value></field> <field var='last'><value>Montague</value></field> <field var='jid'><value>benvolio@montague.net</value></field> <field var='x-gender'><value>male</value></field> </item> <item> <field var='first'><value>Romeo</value></field> <field var='last'><value>Montague</value></field> <field var='jid'><value>romeo@montague.net</value></field> <field var='x-gender'><value>male</value></field> </item> </x> </query> </iq>
There are no security features or concerns related to this proposal.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [3].
The XMPP Registrar [4] shall include the following information in its registries.
The XMPP Registrar includes the 'jabber:iq:search' namespace in its registry of protocol namespaces.
The following fields are reserved for use within jabber:x:data forms scoped by a FORM_TYPE of 'jabber:iq:search'; additional fields MAY be added via the XMPP Registrar's normal registration process but are outside the scope of this document.
<form_type> <name>jabber:iq:search</name> <doc>XEP-0055</doc> <desc>Forms enabling directory searches.</desc> <field var='first' type='text-single' label='First Name'/> <field var='last' type='text-single' label='Family Name'/> <field var='nick' type='text-single' label='Nickname'/> <field var='email' type='text-single' label='Email Address'/> </form_type>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='jabber:iq:search' xmlns='jabber:iq:search' elementFormDefault='qualified'> <xs:import namespace='jabber:x:data' schemaLocation='http://www.xmpp.org/schemas/x-data.xsd'/> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0055: http://www.xmpp.org/extensions/xep-0055.html </xs:documentation> </xs:annotation> <xs:element name='query'> <xs:complexType> <xs:choice> <xs:all xmlns:xdata='jabber:x:data'> <xs:element name='instructions' type='xs:string'/> <xs:element name='first' type='xs:string'/> <xs:element name='last' type='xs:string'/> <xs:element name='nick' type='xs:string'/> <xs:element name='email' type='xs:string'/> <xs:element ref='xdata:x' minOccurs='0'/> </xs:all> <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/> </xs:choice> </xs:complexType> </xs:element> <xs:element name='item'> <xs:complexType> <xs:all> <xs:element name='first' type='xs:string'/> <xs:element name='last' type='xs:string'/> <xs:element name='nick' type='xs:string'/> <xs:element name='email' type='xs:string'/> </xs:all> <xs:attribute name='jid' type='xs:string' use='required'/> </xs:complexType> </xs:element> </xs:schema>
Series: XEP
Number: 0055
Publisher: XMPP Standards Foundation
Status:
Active
Type:
Historical
Version: 1.2
Last Updated: 2004-03-22
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0004
Supersedes: None
Superseded By: None
Short Name: iq-search
Schema: <http://www.xmpp.org/schemas/iq-search.xsd>
Source Control:
HTML
RSS
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata may be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0004: Data Forms <http://xmpp.org/extensions/xep-0004.html>.
2. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.
3. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
4. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
END