Skip to main content

Web Service Method: Create an Analytics Chart Based on Search

Abstract

Web Service Method: Create an Analytics Chart Based on Search

Description

Create a chart based on a search response.

URL: /api/chart

Request

Supported Methods

POST

HTTP Parameters

Parameter

Comment

Type

Required

chartId

Chart Identifier

String

true

searchSpaceId

ID of the search space

String

false

Search Response Object Attributes

The search response attributes that can be used, are the following:

Attribute

Type

Required

Comment

MIMETYPE_PRODUCT_NAME

String

false

facetList

Array of FacetInfo

false

Facets based on the result space

message

String

false

Short descriptive message of the operation result, or an error description.

request

Object

false

Search request

result

Object

false

The actual response content body, defined by the resultType.

resultType

String

false

MIME type of the result if successful, or Exception type if an error occurred.

status

int

true

Indicates the success or error of the HTTP request, on the protocol layer.

success

boolean

false

True if the operation was successful, on the application layer.

total

long

false

Result size

Example Request

Click here to expand...

{
  "MIMETYPE_PRODUCT_NAME" : "some MIMETYPE_PRODUCT_NAME",
  "result" : { },
  "request" : { },
  "total" : 2126,
  "success" : false,
  "facetList" : [ {
    "field" : "some field",
    "label" : "some label",
    "facets" : [ {
      "count" : 17761,
      "language" : "en-gb",
      "label" : "some label",
      "value" : "some value"
    }, {
      "count" : 9569,
      "language" : "en",
      "label" : "some label",
      "value" : "some value"
    } ]
  }, {
    "field" : "some field",
    "label" : "some label",
    "facets" : [ {
      "count" : 32366,
      "language" : "de",
      "label" : "some label",
      "value" : "some value"
    } ]
  }, {
    "field" : "some field",
    "label" : "some label",
    "facets" : [ {
      "count" : 16910,
      "language" : "en",
      "label" : "some label",
      "value" : "some value"
    }, {
      "count" : 1141,
      "language" : "de",
      "label" : "some label",
      "value" : "some value"
    } ]
  } ],
  "message" : "some message",
  "resultType" : "some resultType",
  "status" : 12232
}
FacetInfo

Attribute

Type

Required

Comment

facets

Array of Facet

false

List of facets

field

String

false

Facet field

label

String

false

Facet label

Example FacetInfo Object
{
  "field" : "some field",
  "label" : "some label",
  "facets" : [ {
    "count" : 24730,
    "language" : "cz",
    "label" : "some label",
    "value" : "some value"
  }, {
    "count" : 15564,
    "language" : "fr",
    "label" : "some label",
    "value" : "some value"
  } ]
}
Facet

Attribute

Type

Required

Comment

count

long

false

Facet count

label

String

false

Facet label

language

String

false

Facet language

value

String

false

Facet value

Example Facet Object
{
  "count" : 282,
  "language" : "en",
  "label" : "some label",
  "value" : "some value"
}

Response

Content Type

application/json

Note

The return to this request will display these errors in the following specific cases:

  • If the Search Space ID is wrong, you will receive a 404 'Bad Request' message, with specific information in a JSON message as to the value that was not found.

  • If the credentials were mistyped or wrong: a 403 Forbidden, and a JSON message 'Access denied' will be returned.

  • If you didn't specify a Search Space ID: the return will be made for the default Search Space.

    • If the default Search Space is private and you are not authenticated, you will also receive a 403 Forbidden in a JSON message.

Response Attributes

Response to Chart Setting Call

JSONChartConfig

Highcharts Config

Attribute

Type

Required

Comment

chart

JSONChart

false

Chart type

credits

boolean

false

Credits turned off or on

series

Array of JSONSeries

false

Data points

title

JSONTitle

false

Title of chart

Example Response

{
  "credits" : false,
  "series" : [ {
    "data" : [ {
      "dataPoint" : 0.5036005464458922
    } ],
    "name" : "some name",
    "type" : "column"
  }, {
    "data" : [ {
      "dataPoint" : 0.05562566457466578
    }, {
      "dataPoint" : 0.23184783216968596
    } ],
    "name" : "some name",
    "type" : "line"
  } ],
  "title" : {
    "text" : "some text"
  },
  "chart" : {
    "plotBackgroundColor" : "some plotBackgroundColor",
    "type" : "column2d",
    "plotBorderWidth" : 0.40739676897486576,
    "plotShadow" : true
  }
}