The Data space feature makes it possible to import any kind of data to an account, that can be used in the shop front-end using script. Data space is an account-specific no-SQL elasticsearch database, that can hold a huge amount of data and offers amazing performance for retrieving data using the Data space API or runtime values.
Each account has one data space, which in turn may contain several different tables. Accounts will be billed according to disc space consumption and usage (e.g. number of requests/traffic).
Importing and maintaining data space tables
Data is currently imported to a data space via FTP XML integration, hence the data may come from the ERP system or any other system capable of delivering data in the required format.
It is possible to create complex objects with nested objects and arrays. It is even possible to import data already formatted as JSON using the XML import. See the XML schema documentation for more information about importing data space tables.
Have a look at this example import file containing a data space table named “ShopLocations”, which contains information about three different physical (imaginary) shops.
Each of the entries in the file will upon import be transformed and stored as JSON in the data space table, and each entry will look somewhat like this:
Accessing data from a data space table
Information from a data space table may be accessed via the Data space API using script or by using runtime values (e.g. in a content design).
Getting data from a Data space using the API
The Data space API has the service URL:
It accepts the following URI parameters, which map directly to elasticsearch URI search.
The query string – is passed to elasticsearch as-is. Defaults to "*".
Allows you to specify fields to return in the response. It often makes sense to limit the result fields to what is actually needed, in order to improve performance, reduce the data amount and minimize bandwidth consumption.
- Returns only the fields Name, Latitude and Longitude.
Allows you to sort the result by one or more fields - fieldName:asc/fieldname:desc.
There can be several sort parameters (order is important).
- Sorts the results by Name ascending.
Defines the offset from the first result you want to fetch.
- Gets results starting from the 5th result
Allows you to configure the maximum amount of hits to be returned (defaults to 10.000).
- Gets the first 10 results
- Gets the next 10 results from the 5th result
Supports searching by defining the request body as JSON. Makes it possible to perform JSON aggregation and use other advanced elasticsearch features. Read more about elasticsearch search requests here.
The Data space API returns results formatted as JSON. If no “size” parameter is set in the request, it returns up to 10.000 results.
Getting data from a Data space table using runtime values
You can query a data space table directly from a content design using runtime values.
The syntax for querying a data space table using runtime values is:
<tablename> is the data space table name - case insensitive.
[index] is a required indexer (resulting table is treated as an array with zero or more entries).
<field> is fields as seen in the JSON result - as with other runtime values, you may dive into the object hierarchy - case sensitive.
<elasticsearch options> are the same options as supported by the data space API - here you write your query - are inherently case sensitive.
<eSeller:Select Value-Of="DataSpace:shoplocations.Shop.Name?q=Shop.Address.ZipCode:"5000"" />
- Returns the “Name” value for the first shop with zip code “5000” from the data space table “shoplocations”.
<eSeller:Select Value-Of="DataSpace:shoplocations?q=Shop.Address.ZipCode:"6000"" />
- Returns the first “Shop” object (as JSON) that has zip code “6000” from the data space table “shoplocations”.
<eSeller:Select Value-Of="DataSpace:ShopLocations?q=(Shop.Address.ZipCode:"6000")AND(Shop.Employees:"April")" />
- Returns the first “Shop” object (as JSON) for the shop with zip code “6000” and that has the employee “April”.
Viewing data space tables in the shop administration
In the shop administration you can see a list of all data space tables for an account. The data space overview is located at Integration > Import/Export > Data space.
The overview displays the table name and cache control information about all data space tables in the account.
By clicking “View sample” you can see what kind of information the data space table holds (displays the first 5 entries), and from there you can also click a link to see the response directly in the browser (thus revealing the URL of the data space table).