GET (Search)

Use GET (search) to search for social contacts. GET (search) is based on a Solr search. Wildcard-based searches using "?" for a single-character and "*" for multiple-characters are supported for the fields specified.

You can perform a default search or a field-specific search.

A default search is a freeform search. To perform a default search, add the term you want to search for after "q=" in the GET URL. For example, to search for jsmith, use the following:

https://<ServerIP>:<Port>/ccp-webapp/ccp/search/contacts?q=jsmith

A default search searches the following fields:

  • sc.author

  • sc.title

  • sc.tags

  • sc.description

  • sc.socialContactStatus

  • sc.sourceType

  • sc.isSoftLocked

  • chat.agentName

  • chat.agentNickname

  • chat.transcript

The sc.title, sc.description, and chat.transcript field searches are not case-sensitive. To search in all other fields, the search term you enter must be an exact (case-sensitive) match.

Note

The chat.agentName is always saved in the database in lower case text, no matter how an agent signs in. For example, if an agent signs in as JSmith, you must search for jsmith to find the contact.

To perform a field-specific search, specify the field in which you want to search. The pairs of field names and values in a search query use the following syntax: Solr_field_name:value. You can perform a field-specific search on the following fields:

  • sc.author: The person who created the social contact (chat request).
  • sc.link: The link to the social contact.

  • sc.publishedDate: The date the social contact was published.

  • sc.createdDate: The date the social contact was created.

  • sc.socialContactStatus: The status of the social contact (unread, reserved, handled, discarded, draft, or queued).

  • sc.socialContactStatusDate: The date that the status of the social contact last changed.

  • sc.tags: The tags applied to the social contact. Tags can be applied automatically by the system when the contact enters a feed or manually by a user.

  • sc.sourceType: The feed type to which the social contact belongs.

  • chat.agentNickname: Nickname for the agent in the chat room.

  • chat.agentName: Login username for the agent in the chat room.

  • de.id: The social contact ID. This ID is upper-case. The field is case-sensitive.

The search name and value pairs can be joined in logical expressions by AND or OR. The search terms should be encoded if they contain Solr special characters. (For more details, see https://wiki.apache.org/solr/SolrQuerySyntax.)

Note

The following limitations apply to the search function:

  • Field-based searches search only the specified field for the given term or terms (multiple terms are enclosed in double quotes).

    For example, to search for contacts authored by John Smith, you can search for sc.author:John*, sc.author:*Smith, or sc.author:"John Smith".

  • You can do wildcard-based searches of these fields.

    • sc.author
    • sc.tags
    • chat.agentName
    • chat.agentNickname

    For example, to find social contacts with authors chatAuthorA, chatAuthorB, or chatAuthorC, you can search for chatAuthor*.

  • There is a 32-character limit to the word length (it can only search for words up to 32-characters long).

Search results can contain from 0 to 200 entries. ChatTranscript can be found inside each entry that corresponds to the social contact of type chat.

URL:

https://ServerIP:8080/ccp-webapp/ccp/search/contacts

HTTPS method:

GET

Output format:

ATOM

Parameters:

  • q (required). Query parameter.

  • count (optional.) Defines how many results to return (default = 50, max = 200).

  • startIndex (optional). Identifies the index of the first search result. Because we are using Solr for querying, the first index should be 0 (default = 0).

Example query request:

https://<ServerIP>:<Port>/ccp-webapp/ccp/
search/contacts?q=chat.agentName:admin%20AND%20sc.
socialContactStatus:handled

As illustrated in the previous example, the search request must be URL encoded in order to work (for example, spaces in the text are represented by "%20").

Example XML response:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc=
   "http://purl.org/dc/elements/1.1/" 
   xmlns:ccp="https://www.cisco.com/ccbu/ccp/xml/socialcontact/1.0/" 
   xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
   
  <title>Results of Search</title>
  <link rel="self" href=" https://<ServerIP>:<Port>/ccp-webapp/ccp/
     search/contacts?q=chat.agentName:admin%20AND%20sc.socialContactStatus:
     handled&amp;count=50&amp;startIndex=0" />
  <subtitle>This feed has been created by Cisco SocialMiner</subtitle>
  <id>https://<ServerIP>:<Port>/ccp-webapp/ccp/search/contacts</id>
  <updated>2014-01-14T18:46:27Z</updated>
  <dc:date>2014-01-14T18:46:27Z</dc:date>
  <opensearch:itemsPerPage>1</opensearch:itemsPerPage>
  <opensearch:totalResults>1</opensearch:totalResults>
  <opensearch:startIndex>1</opensearch:startIndex>
  <opensearch:Query role="request" searchTerms="chat.nickname:Tetyana"/>
  <opensearch:link rel="search" type="application/opensearchdescription+xml" 
     href="https://www.cisco.com/opensearch-description.xml" />
  <entry>
    <title>title14</title>
    <link rel="alternate" href="https://<ServerIP>:<Port>/ccp-webapp/ccp/
       socialcontact/91E6B21910000143000032B10A568DD9" />
    <link rel="socialcontact" href="https://<ServerIP>:<Port>/ccp-webapp/ccp/
       socialcontact/91E6B21910000143000032B10A568DD9" />
    <author>
      <name>author14</name>
    </author>
    <id>https://<ServerIP>:<Port>/ccp/socialcontact/
       91E6B21910000143000032B10A568DD9</id>
    <updated>2014-01-14T17:57:28Z</updated>
    <published>2014-01-14T17:57:28Z</published>
    <content type="application/xml">
      <ChatTranscript xmlns="">
        <id>F27C35DD10000134000007160A568DDD</id>
        <endDate>1326918175931</endDate>
        <participants>
           <participant> 
              <agentName>admin</agentName>
              <nickName>Agent</nickName>
           </participant>
        </participants>
        <startDate>1326918153649</startDate>
        <transcript>
          <chat>
            <time>1326918172743</time>
            <name>Agent</name>
            <msg>Hello, how can I help you?</msg>
          </chat>
          <chat>
            <time>1326918173170</time>
            <name>author14</name>
            <msg>Never mind. I'm all set, thanks.</msg>
          </chat>
        </transcript>
      </ChatTranscript>
    </content>
    <dc:creator>author14</dc:creator>
    <dc:date>2012-01-18T20:22:33Z</dc:date>
    <ccp:scstatustimestamp>1326918177731</ccp:scstatustimestamp>
    <ccp:scstatus>handled</ccp:scstatus>
    <ccp:scstatususerid>admin</ccp:scstatususerid>
    <ccp:sourcetype/>
    <ccp:sctags>
      <ccp:sctag>tag14</ccp:sctag>
    </ccp:sctags>
  </entry>
</feed>