price
,
you can set up different prices as subcategories: price.net
, price.gross
, price.margin
.
To refer to nested attributes, separate parent and child attribute with a .
.
To create nested attributes,
add them as nested JSON objects to your records.
For example:
JSON
Example: filtering nested attributes
If you want to filter a search using nested attributes, use thefilters
parameter in your search request
and separate the parent and child attribute by a .
.
For example, with the JavaScript API client:
JavaScript
Where you can use nested attributes
You can use nested attributes wherever you might use a regular attribute, such assearchableAttributes
and attributesForFaceting
.
Just make sure you use the appropriate dot notation such as price.country
to refer to them.
Thereβs no limit on the number of nested attributes apart from the default restrictions on record size.
The depth of nesting is also unlimited: you could use something like price.net.us.ca
.