Ask question

post

/srt/api/v1/search/question

This method returns a set of search results for the specified question.

Example URI

The example URI for this method is as follows:

  • http://<SEARCH_REST_API_HOST>/srt/api/v1/search/question?question=how+do+i+upgrade+my+device

    The request returns a set of search results for the specified question.

  • http://<SEARCH_REST_API_HOST>/srt/api/v1/search/question?question=how+do+i+upgrade+my+device&facet=Collections.OKKB-FAQ

    The request returns a set of pre-filtered search results for the specified content-type, FAQ.

  • http://<SEARCH_REST_API_HOST>/srt/api/v1/search/question?question=how+do+i+upgrade+my+device&facet=CMS-PRODUCT.RN_PRODUCT_1,CMS-PRODUCT.RN_PRODUCT_2&multiFacets=OR

    The request returns a set of pre-filtered search results for the specified products RN_PRODUCT_1 or RN_PRODUCT_2.

Response Errors

The possible error responses for this method are as follows:

  • OK-GEN0003

    The error occurs when the specified query parameters in the request URL are invalid or empty.

A session object stores the session information of a transaction. The session information includes information about the current result set, page tracking, and navigation activity. The implementing agent must store and return the session information back and forth during runtime for each subsequent request.

Facets are a way of categorizing the content. They help you categorize information to enhance the search capabilities. Facet based search allows you to apply multiple filters while searching for information. If you are an author in Information Manger console, you can assign categories to the content and find the facets assigned to the content by referring the assigned categories.

Request

Supported Media Types
Query Parameters
Body ()
The session object which stores the content of a session.
Root Schema : SearchSession
Type: object
Title: SearchSession
Show Source
Nested Schema : CCAInfo
Type: object
Title: CCAInfo
Show Source
Nested Schema : ClientInfo
Type: object
Title: ClientInfo
Show Source
Nested Schema : requestAttributes
Type: array
list of Map Entries
Show Source
Nested Schema : requestHeaders
Type: array
list of Map Entries
Show Source
Nested Schema : requestParameters
Type: array
list of Map Entries
Show Source
Nested Schema : MapEntry
Type: object
Title: MapEntry
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : GIML
Type: object
Title: GIML
Show Source
Nested Schema : SearchConstraints
Type: object
Title: SearchConstraints
Show Source
Nested Schema : Query
Type: object
Title: Query
Show Source
Nested Schema : RequestResult
Type: object
Title: RequestResult
Show Source
Nested Schema : Spellchecked
Type: object
Title: Spellchecked
Show Source
Nested Schema : corrections
Type: array
list of SuggestionBO
Show Source
Nested Schema : Correction
Type: object
Title: Correction
Show Source
Nested Schema : suggestions
Type: array
list of SuggestionBO
Show Source
Nested Schema : Suggestion
Type: object
Title: Suggestion
Show Source
Nested Schema : facets
Type: array
To Many Relationship to child facets
Show Source
Nested Schema : results
Type: array
list of textElements
Show Source
Nested Schema : FacetResultNode
Type: object
Title: FacetResultNode
Show Source
Nested Schema : children
Type: array
To Many Relationship to child facets
Show Source
Nested Schema : ComponentResult
Type: object
Title: ComponentResult
Show Source
Nested Schema : resultItems
Type: array
list of textElements
Show Source
Nested Schema : ResultItem
Type: object
Title: ResultItem
Show Source
Nested Schema : relatedIds
Type: array
List of Ids of the answers related to this answer
Show Source
Nested Schema : textElements
Type: array
list of textElements
Show Source
Nested Schema : TextElement
Type: object
Title: TextElement
Show Source
Nested Schema : snippets
Type: array
Show Source
Nested Schema : Snippet
Type: object
Title: Snippet
Show Source
Back to Top

Examples

The following example shows how to create a question in the repository by submitting a post request on the REST resource using cURL.

cURL Command

curl -X POST "https://<SEARCH_REST_API_HOST>/srt/api/latest/search/question" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json" -d "@<FilePath/RequestBody.json>"

Example of Request Body

The following shows an example of the request body in JSON format.

{
  "session" : "SESSION_VALUE",
  "transactionId" : -470886747,
  "facetPriorTransactionId" : 0,
  "baseURL" : "BASEURL_VALUE",
  "locale" : "LOCALE_VALUE",
  "resultLocales" : "RESULTLOCALES_VALUE",
  "domainGroup" : "DOMAINGROUP_VALUE",
  "navigationApplicationId" : "NAVIGATIONAPPLICATIONID_VALUE",
  "segment" : "SEGMENT_VALUE",
  "querySource" : "QUERYSOURCE_VALUE",
  "uiMode" : "UIMODE_VALUE",
  "requestSource" : "REQUESTSOURCE_VALUE",
  "subject" : "SUBJECT_VALUE",
  "isDeflection" : true,
  "clientInfo" : {
    "agentAddress" : "AGENTADDRESS_VALUE",
    "extSessionId" : "EXTSESSIONID_VALUE",
    "referrer" : "REFERRER_VALUE",
    "cookies" : "COOKIES_VALUE",
    "address" : "ADDRESS_VALUE",
    "host" : "HOST_VALUE",
    "requestHeaders" : [ {
      "key" : "KEY_VALUE",
      "value" : "VALUE_VALUE"
    } ],
    "requestParameters" : [ {
      "key" : "KEY_VALUE",
      "value" : "VALUE_VALUE"
    } ],
    "requestAttributes" : [ {
      "key" : "KEY_VALUE",
      "value" : "VALUE_VALUE"
    } ]
  }
}

Example 1 of Response Body

The following shows an example of the response body in JSON format when the search results match the question.

{
  "constraints" : {
    "baseURL" : "BASEURL_VALUE",
    "language" : "LANGUAGE_VALUE",
    "resultLanguages" : "RESULTLANGUAGES_VALUE",
    "domainGroup" : "DOMAINGROUP_VALUE",
    "navigationApplicationId" : "NAVIGATIONAPPLICATIONID_VALUE",
    "segment" : "SEGMENT_VALUE",
    "querySource" : "QUERYSOURCE_VALUE",
    "uiMode" : "UIMODE_VALUE",
    "requestSource" : "REQUESTSOURCE_VALUE",
    "subject" : "SUBJECT_VALUE"
  },
  "results" : {
    "results" : [ {
      "name" : "NAME_VALUE",
      "pageNumber" : 119012499,
      "pageMore" : -1787984382,
      "pageStart" : 1011298310,
      "score" : 0.8950256205517777,
      "pageSize" : -356445925,
      "unshownResults" : -567000158,
      "totalResults" : 964064210,
      "resultItems" : [ {
        "rule" : "RULE_VALUE",
        "type" : "TYPE_VALUE",
        "fileType" : "FILETYPE_VALUE",
        "answerId" : -2113305261,
        "docId" : -1406261280,
        "score" : 0.0,
        "title" : {
          "url" : "URL_VALUE",
          "type" : "HTML",
          "snippets" : [ {
            "text" : "TEXT_VALUE",
            "level" : 1829155447
          } ]
        },
        "link" : "LINK_VALUE",
        "clickThroughLink" : "CLICKTHROUGHLINK_VALUE",
        "similarResponseLink" : "SIMILARRESPONSELINK_VALUE",
        "highlightedLink" : "HIGHLIGHTEDLINK_VALUE",
        "textElements" : [ {
          "url" : "URL_VALUE",
          "type" : "UNSTRUCTURED",
          "snippets" : [ {
            "text" : "TEXT_VALUE",
            "level" : -1117285219
          } ]
        } ]
      } ]
    } ]
  },
  "session" : "SESSION_VALUE",
  "transactionId" : -1551467838,
  "priorTransactionId" : 28680311
}

Example 2 of Response Body

The following shows an example of the response body in JSON format when there is no content which matches the question asked.

{
    "results": {
        "results": [],
        "facets": []
    },
    "query": {
        "interactive": false,
        "original": "file",
        "paraphrase": "file"
    },
}

Example 3 of Response Body

The following shows an example of the response body in JSON format when search has no data available.

{
    "error": {
        "title": "An application error has occurred. Root Cause: <exception>: OK-SRCH0002 - No Index Data Found.",
        "errorCode": "OK-GEN0003",
        "type": "APPLICATION"
    },
    "errorDetails": [
        {
            "title": "No Index Data Found.",
            "errorCode": "OK-SRCH0002",
            "type": "APPLICATION"
        }
    ]
}

Example 4 of Response Body

The following shows an example of the response body in JSON format when Knowledge search isn't performing correctly.

{
  "error" : {
    "title" : "An application error has occurred. Root Cause: <exception>: Unable to decrypt string",
    "errorCode" : "OK-GEN0003",
    "type" : "APPLICATION"
  },
  "errorDetails" : [ ]
}
Back to Top