Skip to main content
Managing catalog attributes effectively is crucial for a robust e-commerce search and filtering experience. On the Attributes page of the dashboard, you have control over the attributes that are indexed and utilized by our search and browse engine. Here we’ll guide you through each attribute type and how to optimize them for your product listings.
Attributes for Product Options, Shopify’s Standard Product Taxonomy Metafields, and Product Metrics are automatically created during catalog syncs. Please contact support if you need assistance managing complex attributes.

Foundational Architecture

Attributes form the foundation layer of the Layers platform, enabling all higher-level functionality through their core properties:

Attribute Types

Catalog Attributes

The code corresponds to your product schema using Dot Notation, which allows for the targeting of attributes or nested attributes within your data structure. Example of Dot Notation for a product attribute:
{
  "metafields": {
    "custom": {
      "material": "Cotton"
    }
  }
}
In this case, the attribute code would be metafields.custom.material.

Calculated Attributes

/images/attributes-dashboard-calculated.png Calculated Attributes allow you to write formulas using JSONLogic for creating attributes with dynamic values calculated on the fly. A calculated attribute has access to all Catalog Attributes and the raw underlying data from Shopify prior to transformation and indexing.

Data Access in Calculated Attributes

Calculated attributes can access two types of data:
  • Catalog Attributes: Use _attribute:{attribute_code} to reference existing catalog attributes. For example, _attribute:price_range.from or _attribute:published_at.
  • Raw Data: Use _raw:raw.{path} to access raw underlying Shopify data before transformation. Use dot notation for nested properties. For example, _raw:raw.variants or _raw:raw.featured_media.

Platform Default Calculated Attributes

The following calculated attributes are available by default in the Layers platform:
Description: Ratio between total number of variants and their availability status.
{
  "/": [
    {
      "reduce": [
        {
          "map": [
            { "var": "_raw:raw.variants" },
            { "if": [ { "var": "available" }, 1, 0 ] }
          ]
        },
        { "+": [ { "var": "accumulator" }, { "var": "current" } ] },
        0
      ]
    },
    { "count": { "var": "_raw:raw.variants" } }
  ]
}
Description: The number of days since the product became available, based on the imported Published At for the product. If no available date has been imported, the system uses the date the product was created.
{
  "daysSince": {
    "parseDate": {
      "or": [
        { "var": ["_attribute:published_at", null] },
        { "var": ["_attribute:created_at", null] }
      ]
    }
  }
}
Description: If the product has a featured image.
{
  "!!": {
    "var": "_raw:raw.featured_media"
  }
}
Description: The age of the most recently created variant.
{
  "daysSince": {
    "reduce": [
      {
        "map": [
          {
            "var": "_raw:raw.variants"
          },
          {
            "parseDate": {
              "var": "created_at"
            }
          }
        ]
      },
      {
        "if": [
          {
            "or": [
              {
                "==": [
                  {
                    "var": "accumulator"
                  },
                  null
                ]
              },
              {
                ">": [
                  {
                    "var": "current"
                  },
                  {
                    "var": "accumulator"
                  }
                ]
              }
            ]
          },
          {
            "var": "current"
          },
          {
            "var": "accumulator"
          }
        ]
      },
      null
    ]
  }
}
Description: If price_range.from != price_range.to.
{
  "!==": [
    {
      "var": "_attribute:price_range.from"
    },
    {
      "var": "_attribute:price_range.to"
    }
  ]
}
For a comprehensive guide to JSONLogic operators and how to write calculated attribute formulas, see JSONLogic Operators.

Attribute Options

Searchable Attributes

By marking an attribute as Searchable, your products can be found in search results if the search query matches the attribute’s value. This is ideal for text-based attributes such as product names, descriptions, or categories. Attributes that are marked as Searchable and contain an Image URL will automatically be used for Image Search.

Partial Matching

The “Allow Partial Matching” option determines whether a product can match search queries that only partially match the attribute’s value. For instance, if you want customers to find a product by typing just a part of the SKU or Style Code, enable this option. If exact matches are preferred, such as for specific codes, you can disable this option.

Filterable Attributes

Setting an attribute as Filterable enables it to be used as a facet on category or search result pages. This allows customers to refine their searches based on specific product characteristics like size, color, or brand. Learn more in Filters / Facets.

Sortable Attributes

Sortable attributes can be used to create custom Sort Orders for your product catalog. This is useful for allowing customers to sort products according to different criteria, such as price, popularity, or relevance.

Groupable Attributes

Use a groupable attribute to group results and/or metrics by a shared value instead of by individual product IDs—for example, by a style code across variants or related products.
  • What it does: Treat all products with the same group value as one group (e.g., group by style_code) for ranking and reporting.
  • When to use: When you want to rank or measure product families together (styles, sets, or kits).
  • Where to enable: Edit an attribute and toggle “Groupable.”
  • Works with: Metrics and Sort Orders.
Example: If multiple products share the same style_code, enabling Groupable on style_code lets you view metrics and apply sorting at the style level.

Best Practices

  • Use clear, descriptive nicknames for attributes to easily manage and identify them on the dashboard.
  • When setting up searchable attributes, consider the search behavior of your customers and which attributes are most relevant to their queries.
  • For filterable attributes, think about the facets that are most useful for customers when browsing your product range.
  • Regularly review and update your attributes to keep up with changes in your product catalog and customer search behavior.
By following these guidelines, you can ensure that your product attributes are optimized for search and filtering, creating a better shopping experience for your customers.

See also

I