Metadata at field level guide the client for the usage of the parameters and the availability of the data:
|
Attribute |
Type |
Description |
|---|---|---|
|
|
boolean |
Some fields can be sorted: the client is able to use sortBy and sortDirection parameter. |
|
|
boolean |
Some fields can have facets: the client is able to use facets parameters. |
|
|
boolean |
Some fields can be filtered: the client is able to use filters parameters depending on the distribution. |
|
|
{'discrete','continuous'} |
Some fields have continuous distribution (price, resolution, size...) then use filterGreaterThan and filterLowerThan parameters. Some fields have discrete distribution (color, merchantId...) then use filterBy parameter. |
|
|
string |
All fields, whether they can be filtered or not, have a filterKey which can be used to refer to this field when building filters. Its use is described in the documentation on facets |
|
|
boolean |
Some fields are optional. If fields are requested but optional, secure your code: the field will be there but might have a |
|
|
boolean |
On continuous distribution field, |
-
Metadata at field level on fields with a continuous distribution according to the result:
|
Attribute |
Type |
Description |
|---|---|---|
|
|
float |
Minimum value of the field in all offers matching the filters (not only the result). |
|
|
float |
Minimum value of the field in offers in the result. |
|
|
float |
Maximum value of the field in offers in the result. |
|
|
float |
Maximum value of the field in all offers matching the filters (not only the result). |
Note: min <= from <= to <= max
-
Metadata at field level on fields with a discrete distribution according to the result:
|
Attribute |
Type |
Description |
|---|---|---|
|
|
int |
Given field distinct values count in all offers matching the filters (not only the result). |
|
|
int |
Given field distinct values count in all offers in the result. |
Note: distinctValuesCountInResult <= distinctValuesCount
All fields metadata
Check the offer model which is based on the metadata
Examples
Meta data on continuous distribution fields without statistics
-
Given the input parameters are
|
name |
value |
|---|---|
|
query |
nike air max 98 |
|
fieldsMeta |
rebateEndDate |
-
When the client perform a GET on /api/public/search/offers with the input parameters
-
And the json response contains meta/fields with the following content
{
"fields": {
"rebateEndDate": {
"distribution": "continuous",
"canSort": false,
"canFacet": false,
"canFilter": false,
"filterKey": "rebateEndDate",
"isOptional": true,
"statisticsAvailable": false
}
}
}
Meta data on continuous distribution fields with statistics
-
Given the input parameters are
|
name |
value |
|---|---|
|
fieldsMeta |
totalPrice,price |
-
When the client perform a GET on /api/public/search/offers with the input parameters
-
Then I get a response with status 200
-
And the json response contains meta/fields with the following content
{
"fields": {
"totalPrice": {
"distribution": "continuous",
"canSort": true,
"canFacet": true,
"canFilter": true,
"filterKey": "totalPrice",
"isOptional": false,
"isFilterValidated": true,
"statisticsAvailable": true,
"from": 250,
"to": 300,
"min": 100,
"max": 400.5
},
"price": {
"distribution": "continuous",
"canSort": true,
"canFacet": true,
"canFilter": true,
"filterKey": "price",
"isOptional": false,
"isFilterValidated": true,
"statisticsAvailable": true,
"from": 200,
"to": 250,
"min": 100,
"max": 420.99
}
}
}
Meta data on a discrete distribution field without statistics
-
Given the input parameters are
|
name |
value |
|---|---|
|
fieldsMeta |
offerId |
-
When the client perform a GET on /api/public/search/offers with the input parameters
-
Then I get a response with status 200
-
And the json response contains meta/fields with the following content
{
"fields": {
"offerId": {
"distribution": "discrete",
"canSort": false,
"canFacet": false,
"canFilter": true,
"filterKey": "offerId",
"isOptional": false,
"isFilterValidated": true,
"statisticsAvailable": false
}
}
}
Meta data on a discrete distribution field with statistics
-
Given the input parameters are
|
name |
value |
|---|---|
|
fieldsMeta |
merchantId |
-
When the client perform a GET on /api/public/search/offers with the input parameters
-
Then I get a response with status 200
-
And the json response contains meta/fields with the following content
{
"fields": {
"merchantId": {
"distribution": "discrete",
"canSort": false,
"canFacet": true,
"canFilter": true,
"filterKey": "merchantId",
"isOptional": false,
"isFilterValidated": true,
"statisticsAvailable": true,
"distinctValuesCount": 80,
"distinctValuesCountInResult": 3
}
}
}