What is a Metafield?
In Shopify, the metafields object allows you to store additional information for products, collections, pages etc. There are several apps in the Shopify App Store that one can use to manage metafields.
As far as the metafields in Klevu Search are concerned, they can be used as the additional attributes holding additional information about the products that you may want Klevu Search to index and search to bring the relevant products back in the search results. It is also possible to use them as facets and allow your shoppers to filter the results.
The guide below explains how to use metafields in Klevu Search.
Mapping Metafields for Indexing
- Log into MyShopify Admin Panel
- Go to Apps → Klevu Search → Settings
- Click on the Manage Metafields button
Klevu indexes product rating and rating count data separately to other metafields and, as such, the app provides specific rows for you to map the metafields which contain this data. These rows can be found at the top of the metafields table. While they cannot be removed, you should leave these empty if you are not sending rating information.
Because they are not synced in the same way as other metafields, you do not need to enter a title and they will always be indexed as facets.
You should ensure that any metafields mapped always return numeric data.
Note: you cannot map the same metafield for both Rating and Rating Count.
- Rating: reviews.rating
- Rating Count: reviews.rating_count
Below the Rating fields, you can map as many or as few metafields as you need. To add a new definition, click the Add Metafield link and to remove one click the delete icon at the end of the relevant row.
Each row requires a unique Title, as well as the metafield namespace and key (as found under Settings → Metafields → Products in your MyShopify admin area)
If you want to show the Metafield as a facet in search, please tick the Facet checkbox
There are some keys which cannot be sent in the additional metafields section of your feed as they conflict with other attributes in the index, for example rating and rating_count (For an up-to-date list of all reserved keywords, please refer to the Sync Field Name tooltip within the app).
If you wish to map a metafield which uses one of these keys, you will need to provide an alternative key in the Sync Field Name input (with the same reserved key constraints applicable).
Where a Sync Field Name value is present, this is the key which will be used to send data to Klevu, while the metafield mapped using Namespace and Key will continue to be used for the source data.
If you wish to map different metafields which use the same Key value in a different Namespace, you will need to provide an alternative key for one or more conflicting rows in the Sync Field Name input. As with reserved keys, this will only affect the data sent to Klevu, and not the actual metafield used for the source data.
By default, variant metafields are ignored when indexing data unless explicitly enabled through App Settings → Do You Want to Use Variant Product Metafield in Index?
When variant metafields are enabled, you should use the variant’s namespace and key values when mapping in the same way as for product metafields.
Sending Metafields to Klevu
To synchronize these metafields with Klevu Search, please go to Klevu Merchant Center → Catalog Sync → On-demand Sync and click on the Sync Now button.
Does the indexing of metafields slow down indexing?
Beta functionality notice: We are currently trialing a new approach using GraphQL for synching metafields, which may improve sync times for some stores. Please click here for more information.
Unfortunately yes, it will slow down the collection of data for indexing. We use Shopify's API calls to collect the product data. Whilst, with a single API call, we are able to fetch data for more than one product ( allowing us to gather the data at full speed), unfortunately, it isn't yet possible to do the same for metafields. We have to fire one call per product to obtain the metafields information. Given the restrictions on the number of API calls we can fire per second with Shopify when the metafields are configured to be used with Klevu Search, the entire process of collecting data slows down (i.e. up to 600 calls every 5 minutes and 1200 calls every 5 minutes for the Shopify plus account).