CIOBrowseItemsQuery
public struct CIOBrowseItemsQuery : CIORequestData
Struct encapsulating the necessary and additional parameters required to execute a browse items query.
-
The list of item ids to request
Declaration
Swift
public let ids: [String] -
The filters used to refine results
Declaration
Swift
public let filters: CIOQueryFilters? -
The page number of the results
Declaration
Swift
public let page: Int -
The number of results per page to return
Declaration
Swift
public let perPage: Int -
The sort method/order for results
Declaration
Swift
public let sortOption: CIOSortOption? -
The section to return results from
Declaration
Swift
public let section: String -
The list of hidden metadata fields to return
Declaration
Swift
public let hiddenFields: [String]? -
The list of hidden facet fields to return
Declaration
Swift
public let hiddenFacets: [String]? -
The fmt_options to use with the result set Please refer to our docs for more information on available options: https://docs.constructor.com/reference/v1-browse-get-browse-results
Declaration
Swift
public let fmtOptions: [FmtOption]? -
The sort method/order for groups
Declaration
Swift
public let groupsSortOption: CIOGroupsSortOption? -
init(ids:filters: sortOption: page: perPage: section: hiddenFields: hiddenFacets: groupsSortOption: variationsMap: fmtOptions: ) Create a Browse request query object
Usage Example:
let facetFilters = [(key: "Nutrition", value: "Organic"), (key: "Nutrition", value: "Natural"), (key: "Brand", value: "Kraft Foods")] let fmtOptions = [("groups_max_depth": "10")] let browseQuery = CIOBrowseItemsQuery(ids: ["123", "234"], filters: CIOQueryFilters(groupFilter: nil, facetFilters: facetFilters), page: 1, perPage: 30, section: "Products", hiddenFields: ["price_CA", "currency_CA"], hiddenFacets: ["brand", "price_CA"]), fmtOptions: fmtOptions)Declaration
Swift
public init(ids: [String], filters: CIOQueryFilters? = nil, sortOption: CIOSortOption? = nil, page: Int? = nil, perPage: Int? = nil, section: String? = nil, hiddenFields: [String]? = nil, hiddenFacets: [String]? = nil, groupsSortOption: CIOGroupsSortOption? = nil, variationsMap: CIOQueryVariationsMap? = nil, fmtOptions: [FmtOption]? = nil)Parameters
idsThe list of item ids to request
filtersThe filters used to refine results
pageThe page number of the results
perPageThe number of results per page to return
sortOptionThe sort method/order for results
sectionThe section to return results from
hiddenFieldsThe list of hidden metadata fields to return
hiddenFacetsThe list of hidden facest to return
groupsSortOptionThe sort method/order for groups