younifyd
Menu

productProjectionSearch

Full-text + faceted search over product projections — text query, filters, facets, price selection, sorting and limit/offset paging.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the productProjectionSearch action (under Product).
  3. Fill in the fields below, then reference the result from later steps as {{productprojectionsearch.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query ProductProjectionSearch($projectExpandedProducts: Boolean, $locale: Locale, $text: String, $facets: [SearchFacetInput!], $filters: [SearchFilterInput!], $queryFilters: [SearchFilterInput!], $facetFilters: [SearchFilterInput!], $sorts: [String!], $limit: Int, $offset: Int, $fuzzy: Boolean, $fuzzyLevel: Int, $priceSelector: PriceSelectorInput, $markMatchingVariants: Boolean, $markMatchingVariant: Boolean, $storeProjection: String, $localeProjection: [Locale!], $staged: Boolean) {
  productProjectionSearch(
    projectExpandedProducts: $projectExpandedProducts
    locale: $locale
    text: $text
    facets: $facets
    filters: $filters
    queryFilters: $queryFilters
    facetFilters: $facetFilters
    sorts: $sorts
    limit: $limit
    offset: $offset
    fuzzy: $fuzzy
    fuzzyLevel: $fuzzyLevel
    priceSelector: $priceSelector
    markMatchingVariants: $markMatchingVariants
    markMatchingVariant: $markMatchingVariant
    storeProjection: $storeProjection
    localeProjection: $localeProjection
    staged: $staged
  ) {
    offset
    count
    total
    results {
      id
      key
      version
      createdAt
      lastModifiedAt
      productTypeRef {
        typeId
        id
      }
      productType {
        key
        name
        description
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      nameAllLocales {
        locale
        value
      }
      descriptionAllLocales {
        locale
        value
      }
      slugAllLocales {
        locale
        value
      }
      categoryOrderHints {
        categoryId
        orderHint
      }
      categoriesRef {
        typeId
        id
      }
      categories {
        id
        key
        version
        nameAllLocales
        descriptionAllLocales
        slugAllLocales
        ancestorsRef
        ancestors
        parentRef
        parent
        orderHint
        externalId
        metaTitleAllLocales
        metaKeywordsAllLocales
        metaDescriptionAllLocales
        stagedProductCount
        childCount
        children
        createdAt
        lastModifiedAt
        assets
        custom
        createdBy
        lastModifiedBy
      }
      searchKeywords {
        locale
        searchKeywords
      }
      metaTitleAllLocales {
        locale
        value
      }
      metaKeywordsAllLocales {
        locale
        value
      }
      metaDescriptionAllLocales {
        locale
        value
      }
      hasStagedChanges
      published
      masterVariant {
        id
        key
        sku
        prices
        images
        assets
        availability
        isMatchingVariant
        scopedPrice
        scopedPriceDiscounted
      }
      taxCategoryRef {
        typeId
        id
      }
      taxCategory {
        name
        description
        rates
        key
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      stateRef {
        typeId
        id
      }
      state {
        id
        version
        key
        type
        roles
        nameAllLocales
        descriptionAllLocales
        builtIn
        transitionsRef
        transitions
        initial
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      reviewRatingStatistics {
        averageRating
        highestRating
        lowestRating
        count
        ratingsDistribution
      }
    }
    facets {
      facet
      value {
        type
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

projectExpandedProductsboolean
localestring
textstring
facetsarray<object>
modelobject2 fields
stringstring
filtersarray<object>
modelobject5 fields
stringstring
queryFiltersarray<object>
modelobject5 fields
stringstring
facetFiltersarray<object>
modelobject5 fields
stringstring
sortsarray<string>
limitnumber
offsetnumber
fuzzyboolean
fuzzyLevelnumber
priceSelectorobject
currencystringrequired
countrystring
customerGroupobject2 fields
channelobject2 fields
datestring
markMatchingVariantsboolean
markMatchingVariantboolean

Deprecated: please use 'markMatchingVariants'.

storeProjectionstring
localeProjectionarray<string>
stagedboolean
json
{
  "projectExpandedProducts": false,
  "locale": "string",
  "text": "string",
  "facets": [
    {
      "model": {
        "terms": "string",
        "range": "string"
      },
      "string": "string"
    }
  ],
  "filters": [
    {
      "model": {
        "value": "string",
        "range": "string",
        "missing": "string",
        "exists": "string",
        "tree": "string"
      },
      "string": "string"
    }
  ],
  "queryFilters": [
    {
      "model": {
        "value": "string",
        "range": "string",
        "missing": "string",
        "exists": "string",
        "tree": "string"
      },
      "string": "string"
    }
  ],
  "facetFilters": [
    {
      "model": {
        "value": "string",
        "range": "string",
        "missing": "string",
        "exists": "string",
        "tree": "string"
      },
      "string": "string"
    }
  ],
  "sorts": [
    "string"
  ],
  "limit": 0,
  "offset": 0,
  "fuzzy": false,
  "fuzzyLevel": 0
}

Response

Read the result with {{productprojectionsearch.response.data.data.productProjectionSearch}}. If the API returns errors, the step fails and they are at {{productprojectionsearch.response.data.errors}}.

offsetnumber
countnumber
totalnumber
resultsarray<object>
idobject
keyobject
versionobject
createdAtobject
lastModifiedAtobject
productTypeRefobject
productTypeobject
nameAllLocalesobject
descriptionAllLocalesobject
slugAllLocalesobject
categoryOrderHintsobject
categoriesRefobject
categoriesobject
searchKeywordsobject
metaTitleAllLocalesobject
metaKeywordsAllLocalesobject
metaDescriptionAllLocalesobject
hasStagedChangesobject
publishedobject
masterVariantobject
taxCategoryRefobject
taxCategoryobject
stateRefobject
stateobject
reviewRatingStatisticsobject
facetsarray<object>
facetobject
valueobject

Need more? See the Commercetools guide for connection setup and behaviour shared by every action.