Community articleSocial parameter to Search API
Added by IBM contributorIBM on December 21, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.
The "social" parameter to the Search API allows the user of the API to specify a query that is social network oriented. For example, a search for all data relevant to a certain person or a certain community.

Request Format


The "social" parameter can repeat multiple times. Each instance of the parameter defines an entity which is added to the search query.

The "social" parameter instances are combined with the "query" parameter using an AND semantic.

If only "social" clauses are required, the "query" parameter can be omitted.
 
The value of the "social" parameter is a JSON string, which defines the queried entity.
 
Name
Description
Default Value
Comments
type
The requested entity type
---
The supported types in Connections are "personUserId", "personEmail", "community" and "tag"
id
The ID of the requested entity
---
 

Examples

Example 1: The following call contains a request to receive data relevant to the person whose email is "john.doe@example.com". The result should contain the top 10 related documents, and the top 15 related tags:
/search/atomfba/mysearch?social={"type":"personEmail","id":"john.doe@example.com"}&facet={"id":"Tag","count":15}
 
Example 2: The following call contains a request to receive people related to the community whose id is "aa4de9a2-2bc5-4adb-8b25-b0d04bc6472a". The result should contain the top 10 related people (and no documents). Note: count=10 is the default value in the facets definition:
/search/atom/search?pageSize=0&social={"type":"community","id":"aa4de9a2-2bc5-4adb-8b25-b0d04bc6472a"}&facet={"id":"Person"}

Example 3: The following call contains a request to receive data relevant to both the keyword "Lucene" and the tag "search". The result should contain the top 10 related documents, and the top 5 related people:
/search/atomfba/mysearch?query=Lucene&social={"type":"tag","id":"search"}&facet={"id":"Person","count":5}