Search for information programmatically
Search IBM Connections to find content that contains a specific text string in its title, description or content, or to find information tagged with a specific tag term.Table 1. Atom API request details
Resource Description /atom/search/results Search IBM Connections for public information. /atom/mysearch/results Search IBM Connections for both public information and private information that you have access to. Provide authentication information in the request to retrieve this resource. You must specify at least one of the following parameters; you can specify more than one. Separate multiple parameters with an ampersand (&).
Table 2. Input parameters
Parameter Description component Limits the search results to include items from a specific application. If you specify multiple applications, this parameter acts as an AND operator. To specify multiple applications, type a comma between each application name. For example, if you specify component=dogear,activities, the results would be limited to all of the activities that have been dogeared or all activity bookmarks that are also dogeared. Options are:
- activities
- blogs
- communities
- dogear
- files
- forums
- profiles
- wikis
components Limits the search results to include items from a specific application. If you specify multiple applications, this parameter acts as an OR operator. To specify multiple applications, type a comma between each application name. For example, if you specify components=dogear,activities, the results would include all items from Activities or Bookmarks that match the search criteria. Options are:
- activities
- blogs
- communities
- dogear
- files
- forums
- profiles
- wikis
Limits the results to only those items associated with the person who has the specified email address. For example, the person could be the author of an activity entry that is returned or a member of the community returned. lang Specifies a language in which to search for a string. This parameter is optional. When specified, the appropriate dictionary for the specified language is loaded. You can specify any of the following language codes:
arArabic
cs
Czech
da
Danish
de
German
el
Greek
en
English
es
Spanish
fi
Finnish
fr
French
it
Italian
ja
Japanese
ko
Korean
nb
Norwegian
nl
Dutch
pl
Polish
pt-BR
Brazilian Portuguese
pt-PT
Iberian Portuguese
ru
Russian
sv
Swedish
zh
Chinese
Note: The dictionary for the language specified must be enabled for this parameter to work. See Configure dictionaries for search for more details.
query Text to search for. Returns a list of results with the specified text in the title, description, or content. Encode the strings. By default, spaces are treated as an AND operator. The following operators are supported:
- AND or &&: Searches for items that contain both words. For example: query=red%20AND%20test returns items that contain both the word red and the word test. AND is the default operator.
- NOT or !: Excludes the word that follows the operator from the search. For example: query=test%20NOT%20red returns items that contain the word test, but not the word red.
- OR: Searches for items that contain either of the words. For example: query=test%20OR%20red
- To search for a phrase, enclose the phrase in quotation marks (" ").
- +: The plus sign indicates that the word must be present in the result. For example: query=+test%20red returns only items that contain the word test and many that also contain red, but none that contain only the word red.
- ?: Use a question mark to match individual characters. For example: query=te%3Ft returns items that contain the words test, text, tent, and others that begin with te.
- -: The dash prohibits the return of a given word. This operator is similar to NOT. For example: query=test%20-red returns items that contains the word test, but not the word red.
Note: Wildcard searches are permitted, but wildcard only searches (*) are not.
For more details about supported operators, see Advanced search options in the Using section of the product documentation.tag Tag to search for. Returns a list of results with the specified tag. You can use this parameter multiple times to search for content that is tagged with all of the tag terms. userid Limits the results to only those items associated with the person who has the specified user ID. This parameter overwrites the email parameter if both are specified. The Home page query syntax is based on the Lucene query parser syntax. However, only the syntax options listed in the description for the query parameter are supported. For more information, go to the following external web site:
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html
![]()
Table 3. Optional paging input parameters
Parameter Description page Page number. Specifies the page to be returned. The default is 1. ps Page size. Specify the number of entries to return per page. results* Synonymous with ps parameter. start* Defines an offset from the first result in the set. This parameter is ignored if a page parameter is provided. This starts from 0. The default is 0.
You can use the ps and page parameters together or the results and start parameters together, but do not mix parameters from the two sets together.
- Identifies parameters that are supported in Lotus Quickr searches.
Examples
Here are some quick query syntax examples:query=red&component=blogs&component=dogear
Returns all of the blogs that have been bookmarked in Bookmarks and that contain the word red.
query=red&tag=colour
Returns any items containing the word red and that are tagged with the term colour.
query=red&component=activities&userid=myuserid
Returns all of the activities that contain the word red that the user specified by the myuserid is involved in.
query=red&userid=myuserid&userid=youruserid
Returns all of the items that contains the word red and that the person specified by the myuserid and the person specified by the youruserid are both involved.
Example
To search for all content across IBM Connections that contains the text Red, send the following HTTP request:
> GET /search/atom/search/results?query=%22Red%22 HTTP/1.1 > Host: example.enterprise.com:9443 > Accept: */*The following content is returned by the server:
<?xml version="1.0" encoding="UTF-8" ?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn"> <title>"Red"</title> <link href="https://example.enterprise.com:9443/search/atom/search/ results?query=%22Red%22" rel="self" /> <updated>2008-10-07T22:58:03Z</updated> <id>https://example.enterprise.com:9443/search/atom/search/ results?query=%22Red%22</id> <openSearch:totalResults>2309</openSearch:totalResults> <openSearch:itemsPerPage>10</openSearch:itemsPerPage> <openSearch:startIndex>1</openSearch:startIndex> <link href="http://search-server:9080/search/atom/search/facets/ source?query=%22Red%22" rel="related" /> <link href="http://search-server:9080/search/atom/search/facets/ tags?query=%22Red%22" rel="related" /> <link href="http://search-server:9080/search/atom/search/facets/ people?query=%22Red%22" rel="related" /> <link href="http://search-server:9080/search/atom/search/ results?query="Red"&page=2" rel="next" /> <link href="http://search-server:9080/search/atom/search/ results?query="Red"&page=230" rel="last" /> <openSearch:Query role="request" searchTerms=""Red"" /> <entry> <title>Boston Red Sox - Red Sox - Boston.com</title> <link href="http://www.boston.com/sports/baseball/redsox/" /> <id>urn:uri:1547735</id> <updated>2007-12-22T13:26:40+00:00</updated> <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="search" /> <category scheme="http://www.ibm.com/xmlns/prod/sn/component" term="dogear" /> <category term="red" /> <category term="red_sox" /> <category term="sports" /> <category term="sox" /> <category term="baseball" /> <author> <name>John E. Smith</name> <snx:userid>177crjc0-8f0a-1028-8f0c-db93503b53t4</snx:userid> </author> <summary type="html" /> <relevance:score>5.4105196</relevance:score> </entry> ... </feed>
Parent topic
Getting Search feedsRelated concepts
Configure dictionaries for Search
Advanced search optionsRelated reference
Search result entry content
});