jabber:iq:search
The jabber:iq:search is closely related to the
jabber:iq:register namespace, in that the dance
steps are pretty much the same. As with
jabber:iq:register, you can discover which entities
(usually server components) support search features from the results
of an agents or browse query, as shown in Example 6-3.
Also, as with the jabber:iq:register namespace, the
fields to be used in the interaction are first retrieved with an IQ-get
qualified by the jabber:iq:search namespace.
Here we see an example of that with the JUD running on the
jabber.org server:
SEND: <iq type='get' to='users.jabber.org' id='800'>
<query xmlns='jabber:iq:search'/>
</iq>
RECV: <iq type='result' from='users.jabber.org'
to='qmacro@jabber.org/laptop' id='800'>
<query xmlns='jabber:iq:search'>
<instructions>
Fill in a field to search for any matching Jabber User
</instructions>
<first/>
<last/>
<nick/>
<email/>
</query>
</iq>
To continue the similarity theme, an IQ-set is used to submit the search, sending back a value (or values) in the fields like this:
<email>pipetree.com</email>.
The only exciting feature of the jabber:iq:search
namespace is perhaps the way it can return results in response to an
IQ-set. This depends on the component and how the feature is
implemented.
While the JUD component will return all results in one IQ element:
RECV: <iq type='result' from='users.jabber.org' to='qmacro@jabber.org/laptop'> <query xmlns='jabber:iq:search'> <item jid='qmacro@jabber.org'> <name>DJ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access