ContentOnTarget provide a JSON over HTTP API to search for documents.

Detail Pages

There are three detail pages available:


The API is available with this URL path:


Possible Query Parameters

The API provides following parameter possibilities:

/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query

Search Parameter according to the Query Syntax

/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&offset=10

specifies the position from which possible search results should be provided

minimal value: 0

/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&offset=10&length=20

specified the number of documents which have to be provided at maximum

supported range: 0-100

/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&fields=["uri","testField1","testField2"]

specifies the fields of interest in addition to the score field (which specifies the relevancy of the search result).

The requested fields have to match the CoreSchema specification. If no field is requested, following fields are provided by default:

  • uri
  • score

Additionally to these standard parameters, the system also supports faceting, filtering and sorting

/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&facets=[{"field":"price"}]
Enables facet calculating. More details can be found on Faceted Query.
/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&filter=[{"field":"brand","value":"siemens}]
/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&filter={"type"="OR","fields":[{"field":"brand","value":"siemens}]}
Filters the search results. More details can be found on Filtered Query.
/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&sort={"field":"ASC", "field2":"DESC"}
Sorts the search result. More details can be found on Sorted Query.
/api/2.2/[user]/[core]/[apiHash_Core]/search/?q=search query&group=field2
Provides a grouped search result: More details can be found on Grouped Query.



On success, the response header is of type 200, the body contains the JSON response with the productNumber and the title.


"searchResults": {
  "totalResults": 50,
  "results": [
	{"productNumber":"123456","title":"Title of the product", "score","1.557"},...
"alternativeSearchResults": {
  "query":"alternative search query",
  "totalResults": 50,
  "results": [
	{"productNumber":"123456","title":"Title of the product", "score","1.557"},...
"searchSuggestions": {
  [{"suggestion":"Titel of the product", "frequency":15},...
query timethe time needed to execute the search in milliseconds
searchResultssearch results, consisting of a list of data objects
alternativeSearchResults (opt)

in case that the search query was misspelled or there are less than 5 results, an alternative search might be applied. This happens if a similar query can be identified that would return more results. Thus the system provides the possibility to display most relevant search results even in case of misspellings.

searchSuggestions (opt)

Although a query provides a set of related documents, there might be similar, better queries. These alternative search queries are provided as suggestions including the number of documents to provide the user the possibility to improve the search. This could also be used in a "Did you mean" function.

Attention: if alternativeSearchResults is present, the most relevant searchSuggestion is already used.

PHP API Client

The PHP API client provides full support for the fulltext search

$config = com\repalogic\ContentOnTarget\Client\Configuration::getConfig("", "userName", "userApiHash", "coreName", "coreApiHash");

$searchApi= new com\repalogic\ContentOnTarget\Client\SearchApi($config);

//specify a root filter (supporting complex boolean filtering)
$rootFilter = new com\repalogic\ContentOnTarget\Client\RootFilterSetting();
//specify a first level filter for manufacturers
$firstLevelFilter = new com\repalogic\ContentOnTarget\Client\FirstLevelFilterSetting();
$filterFieldSetting = new com\repalogic\ContentOnTarget\Client\FilterFieldSetting();
//specify a facet calculation
$facetSetting = new com\repalogic\ContentOnTarget\Client\FacetSetting();
$facetField = new com\repalogic\ContentOnTarget\Client\FacetFieldSetting();
$facetField2 = new com\repalogic\ContentOnTarget\Client\FacetFieldSetting();
$searchResults = $searchApi->search("search query",0,20,$rootFilter,$facetSetting);