XMPP API

The XMPP API consists of three major parts - the real time search results, the update notifications for watched searches, and the archive queries. All three pieces are based on XMPP Pubsub.

Before the XMPP API can be used, an application must be able to communicate via the XMPP protocol. This is most commonly done by connecting to an XMPP server. Please note it is not necessary to run your own XMPP server. For more information on XMPP connections, please see the XMPP connections documentation.

Real Time Search Results

In order to get real time results for a query, a subscription is made to the search query. Once a subscription is obtained, the incoming data stream is searched for matches, and the API consumer will be notified via pubsub events whenever a match is found.

For more information on the real time results portion of the API, please see the real time results documentation.

Update Notifications

Some applications may be interested only in how busy a particular query is at any given time. For this reason, the Collecta search API also has update notifications for other queries. These notifications tell the application when new items are received by the server for the watched query. For example, on the Collecta Web site, the user watches real time results from one query, while also receiving activity notifications of all the other queries that interest them.

Support for update notifications is done by specifying the queries the application wishes to receive notifications for as a subscription option to pubsub.

For more information on the update notification portion of the API, please see the update notification documentation.

Archive Queries

In order to provide context for a user's query, an application can query the most recent matching results from the historical archive of data. While this is already possible via the HTTP API, it can also be done with over XMPP if that is more convenient.

Archive queries are also done using XMPP pubsub, but instead of doing a subscription, the application requests past items for a query.

For more information on the archive query portion of the API, please see the archive query documentation.

< Home