for

Index Schema

Understand how we format the data pushed to Algolia.


This plugins formats your data in an optimal and extensible format so that it can better serve your Shopify search experience.

You will find on this page some explanations about how we format your data, how we configure your Algolia indices, and how you can customize it.

Products

Products indexed in Algolia are actually Shopify variants.
Some of their attributes are inherited from the associated product, others are specific to this variant.

The image attribute is filled using the variant's picture if it exists, otherwise it will use the first picture of the associated product.

Schema

{
  objectID,                       // Variant id (unique identifier also used by Algolia)
  sku,
  barcode,
  id,                             // Product id
  title,                          // Name of the product
  variant_title,                  // Name of the variant
  product_type,
  vendor,
  handle,                         // URL handle for the product
  tags,
  named_tags: {                   // Key value association from tags like this: "key:value" (See Named tags section)
    <TAG_KEY>
  },
  body_html_safe,                 // Description (without HTML, truncated to 2000 characters)
  compare_at_price,               // Initial price
  price,                          // Actual (optionally discounted) price
  price_ratio,
  price_range,
  variants_count,                 // Total count of the variants of the related product
  variants_min_price,             // Min price of all the variants of the related product (only relevant with distinct enabled)
  variants_max_price,             // Max price of all the variants of the related product (only relevant with distinct enabled)
  option1,                        // Variant option 1
  option2,                        // Variant option 2
  option3,                        // Variant option 3
  options: {                      // Hash containing the option `names: value`
    <OPTION_NAME>
  },
  option_names,                   // Array containing the option names, in order
  requires_shipping,
  taxable,
  grams,
  weight,                         // Weight with its original unit
  image,
  product_image,
  inventory_management,           // Inventory management system used
  inventory_management_shopify,   // Is the inventory management system shopify (1 if yes, 0 if no)
  inventory_quantity,             // Number of available items in the inventory
  position,                       // Position of the variant in the list of products
  template_suffix,
  meta: {                         // Metafields (See Metafields section)
    namespace1: {
      key1,
      key2
    },
  },
  created_at,
  updated_at,
  published_at,
  recently_ordered_count,          // How much have recently been ordered : useful for ranking
  collections: [
    'collection-1-handle'          // Array of product collections handles
  ]
}

The attributes we do textual search in are (in order of importance):

Attribute name
vendor
title
variant_title
product_type
tags
handle
sku
barcode
body_html_safe

Displaying by product / most relevant variant

If you want to have the most relevant variant in your results instead of all variants, it's easy.
Just select the Show products option in the Display tab.

Ignoring a product

Removing a product from the search results is easy. You can either:

  1. add algolia-ignore to its list of tags
  2. or add [hidden] to its name (lowercase, with brackets)

Ignoring a variant

Removing a variant from the search results is easy. Since variants don't have tags, you can only or add [hidden] to its name (lowercase, with brackets). The variant name is the value of the option.

Example: for the color option, a variant name could be blue.
Call it blue [hidden] or [hidden] blue to avoid indexing it.

Products Collections Faceting

Faceting on collections is possible by enabling the indexing of products collections.

Beware, do not confuse Collections indexing and Products Collections Indexing:

  • Collections indexing: enable autocomplete to search in collections
  • Products Collections Indexing: enable collection faceting for Instant Search page.

Products Collections Faceting is a beta feature, only available for shops with less than 10 000 products.

For a simple technical reason:

  • when a collection is updated or created, all products contained into this collection are re-indexed. Example: since Algolia index variants, a collection containing 1 000 products with 5 variants each trigger a re-index for 5 000 objects.

More information on configuring this feature on the Collection search page documentation.

Collections

Collections are way simpler objects than the products.

Schema

{
  objectID,           // Collection id (in Shopify & Algolia)
  title,
  handle,             // URL handle
  body_html,          // Description (with HTML, truncated to 2000 characters)
  body_html_safe,     // Description (without HTML, truncated to 2000 characters)
  image,
  products_count,     // Product count in the collection (not updated in real-time)
  template_suffix,
  meta: {             // Metafields (See Metafields section)
    namespace1: {
      key1,
      key2
    },
  },
  updated_at
}

The attributes we do textual search in are (in order of importance):

Attribute name
title
handle
body_html_safe

Ignoring a collection

Removing a collection from the search results is easy. Since collections don't have tags, you can or add [hidden] to its name (lowercase, with brackets).

Example: for a collection named Summer, call it Summer [hidden] or [hidden]Summer to avoid indexing it.

Articles

Articles look pretty much like collections.

Schema

{
  objectID,           // Article id (in Shopify & Algolia)
  title,
  handle,             // URL handle
  body_html,          // Description (with HTML, truncated to 2000 characters)
  body_html_safe,     // Description (without HTML, truncated to 2000 characters)
  image,
  tags,
  created_at,
  updated_at,
  meta: {

  },
  author: {
    objectID,
    name
  },
  blog: {
    objectID,
    title,
    handle,
    commentable,
    feedburner,
    feedburner_location,
    created_at,
    updated_at,
    meta
  }
}

The attributes we do textual search in are (in order of importance):

Attribute name
title
handle
tags
blog.title
blog.handle
author.name
body_html_safe

Ignoring an article

Removing an article from the search results is easy. You can either:

  1. add algolia-ignore to its list of tags
  2. or add [hidden] to its name (lowercase, with brackets)

Ignoring a blog entirely

Articles belong to blogs, and you can remove all the articles of a specific blog from the search results. Since blogs don't have tags, to do so, you can only add [hidden] to the blog name.

Pages

Schema

{
  title,
  author,
  created_at,
  body_html,
  objectID,
  updated_at,
  meta,
  handle,
  shop_id,
  template_suffix,
  published_at,
  body_html_safe,
}

Ignoring a page

The plugin allow to hide a page. You can either:

  1. add algolia-ignore to its list of tags
  2. or add [hidden] to its name (lowercase, with brackets)