CIOBrowseItemsQuery

public struct CIOBrowseItemsQuery : CIORequestData

Struct encapsulating the necessary and additional parameters required to execute a browse items query.

  • ids

    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 sort method/order for groups

    Declaration

    Swift

    public let groupsSortOption: CIOGroupsSortOption?
  • Create a Browse request query object

    Usage Example:

    let facetFilters = [(key: "Nutrition", value: "Organic"),
                        (key: "Nutrition", value: "Natural"),
                        (key: "Brand", value: "Kraft Foods")]
    
    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"]))
    

    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)

    Parameters

    ids

    The list of item ids to request

    filters

    The filters used to refine results

    page

    The page number of the results

    perPage

    The number of results per page to return

    sortOption

    The sort method/order for results

    section

    The section to return results from

    hiddenFields

    The list of hidden metadata fields to return

    hiddenFacets

    The list of hidden facest to return

    groupsSortOption

    The sort method/order for groups