Get suggested articles
/km/api/v1/suggestedSearch
This method returns the list of suggested article objects based on the specified search-keywords. The article titles are returned only when the titles contain the search keywords either partially or completely.
NOte:Before using the suggested search resource, ensure that attribute level searching for the master identifier of the content-type is enabled and to run reindex on conten-types. For more information, see Knowledge Advanced Administration Guide.
When you send a GET request for the suggested search resource, you must specify query parameter (q) in the request.
Example URIs
The example URIs for this method are as follows:
http://
/api/latest/suggestedSearch?q=cloud The request returns a list of suggested article objects that have the word 'cloud' in the titles.
http://
/api/latest/suggestedSearch?q=cloud&contentState=PUBLISHED The request returns a list of suggested article objects which are published and which contain the word 'cloud' in the titles.
http://
/api/latest/suggestedSearch?q=cloud&limit=10 The request returns a list of maximum of 10 suggested article objects which contain the word 'cloud' in the titles.
The following table describes the query parameters for this resource.
Parameter | Description |
---|---|
q | Input query text |
applyCTIndexStatus | Optional flag that sets the status filter same as the document status for indexing by Oracle Knowledge Search, defined on the content type. |
limit | Number of suggestions to be received in response. This is optional. |
categories | Comma separated product or category reference keys to be applied to filter the suggestions. This is optional. |
matchAllCategories | Optional flag that specifies to return article title as suggestion that are associated with all the product or category reference keys sent in the request parameter 'categories'. This parameter is ignored if the parameter 'categories' is not sent in the request. If this parameter is not specified or if the value is false, then article titles associated with any of the product or category reference keys specified for 'categories' will be returned as suggestions. |
Article Locale
When you send a request, you can specify the target locale of an article in one of the following ways.
- Specify the required locale code in the Accept-Language header. Example:
Accept-Language: en-US
- Specify the langpref request parameter and its value within the HTTP request. Example:
GET http://
/km/api/latest/suggestedSearch?langpref=es_ES - Specify the localeId attribute and its value in the kmauthoken. Example:
kmauthtoken: {siteName:example_site_name, locale:es_ES}
- The locale value of an article is specified in the following ways:
- When Accept-Language header, langpref parameter, and localeID values are specified in a single request, Accept-Language header value takes precedence.
- When a value is not specified for the Accept-Language header, then langpref value is considered.
- When a value is not specified for the Accept-Language header, then langpref value is considered.
- When a value is not specified for both Accept-Language header and langpref parameter, only then the value of localeId attribute is considered
Interface ID
When using the suggested search resource, you can request an article which is associated with a specified Oracle B2C Service interface. For example, the following request retrieves the article from the Customer Portal that has the interface ID value of 3.
GET http://
The locale of an article is determined by the Oracle B2C Service interface mapping to the Knowledge Advanced view and locale. For more information, see Knowledge Advanced user documentation.
NOTE: If the kmauthtoken header contains an Interface ID value, then the service returns only documents that are mapped to the specified interface.
Response Errors
The possible error responses for this method are as follows:
The error occurs when the requested index of the content is corrupted.
The error occurs when the queried content could not be found.
The error occurs when query parameter (q) is not specified in the request or when no value is specified for the parameter q.
Request
There are no request parameters for this operation.
Back to TopResponse
- application/json
- application/xml
200 Response
object
ResultList SuggestedArticle
-
allOf
Collection Paging Resource
Title:
Collection Paging Resource
Oracle base collection resource schema definition. -
object
ResultList SuggestedArticle-allOf[1]
Collection Paging Resource
-
allOf
Base Collection Resource
Title:
Base Collection Resource
Oracle base collection resource schema definition. -
object
Collection Paging Resource-allOf[1]
Base Collection Resource
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
Base Collection Resource-allOf[1]
object
Singular Resource
object
-
count(optional):
integer
Number of resource instances returned in the current range.
-
hasMore(optional):
boolean
Boolean value that is set to true if more resources are available on the server than the subset returned in current page.
-
limit(optional):
integer
Actual paging size used by the server.
-
offset(optional):
integer
Offset value used in the current page.
-
totalResults(optional):
integer
Total count of the resource instances, including both the instances in the current range and the instances on the server that satisfy the request.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
-
href:
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
-
profile(optional):
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel:
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated(optional):
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
object
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
ContentKey-allOf[1]
object
-
allTranslations(optional):
array allTranslations
This field will return list of all translated content that the user can view
This field will only be populated if allTranslations query parameter is passed in with value true.
-
answerId(optional):
integer
The unique identifier that enables mapping between an answer and the content.
-
dateModified(optional):
string(date-time)
The date when the content was last modified in the Oracle Knowledge Repository.
-
documentId(optional):
string
The unique identifier of a document that indicates the content type in which the content is saved.
-
locale(optional):
LocaleKey
-
recordId(optional):
string
The unique identifier of the document. This ID is same in all versions in all locales of the document.
-
title(optional):
string
The tittle of the document.
-
version(optional):
string
Version of the Content object
-
versionId(optional):
string
The unique identifier of the specific version of a document in a specific locale. You cannot use this field in queries made using q query parameter.
object
-
highlightedTitle(optional):
string
Article title with user query string highlighted.
array
This field will return list of all translated content that the user can view
This field will only be populated if allTranslations query parameter is passed in with value true.
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
LocaleKey-allOf[1]
object
-
recordId(optional):
string
The unique identifier of the Locale object.