Skip to content

Product and Content Data

Without products or other content (collectively known as entities), there would be nothing to search for or recommend, so naturally this is important data. Most likely, you already have this data on your website, PIM or ERP, and Relewise will need to be given an 'up-to-date version of this (sent via the API or the feeds feature in My relewise).

To get started with providing Entity Data via the API, click here

A Note on Disabled Entities

All entities in Relewise can be disabled, typically by using an Administrative action (ProductAdministrativeAction or ContentAdministrativeAction). A disabled entity will not be shown in Relewise results, and as such will never be returned in Search or Recommendations powered by Relewise.

It is important to note that disabled entities will be removed from Relewise after a period of time, to save on storage space. For this reason, you should never disable an entity that you are not willing to lose. Keep in mind that deleted entities also lose their associated tracking metrics, such as sales statistics, entity relations etc. This data, once deleted, cannot be recovered.

Disabling an entity should be used as a "soft delete", and not as a way of removing entities from Relewise results while keeping the entity stored. Relewise is not a data storage space, and we take active steps to keep the data we save to a minimum - to ensure that our prices remain as low as possible.

To keep certain elements out of your search or recommendation results, you should use a merchandising rule to filter out entities you do not want shown. For rules that need to target more than a few entities, adding a datakey such as filterOut = True to the entities can allow for quick and easy maintenance of the filter list, entirely within your PIM or CMS system.

Product Data

Product data is the products you sell. We do not need every single detail about a product, only the subset that is relevant to your type of searches and recommendations. Common examples of such metadata are: Name, Id, Product Group, Variant, and Brand, but you can send and configure any kind of data. For example, if you sell wine, country, wine type, and year would be relevant extra data.

Our product model supports the following

You can read more about the types of data we support here.

Importing Products

When importing data into Relewise, it is advisable to include as few fields as possible to ensure optimal performance. To help ensure that you get the correct data imported, consider these criteria when evaluating the data fields on your products:

  • Should the field be text searchable?
  • Should results be able to be filtered on the basis of this field?
  • Should results be able to be sorted on the basis of this field?
  • Is the field necessary for facetting?
  • Is the field necessary for boost/bury rules or similar Merchandising rules?
  • Do you need this field to be returned in results from Relwise (e.g. for displaying on the website)?

If you can answer yes to at least one of these, the field should be included. Otherwise, leave it out.

Variant Data

ProductVariants are treated exactly like a regular product as far as Relewise is concerned. The only difference is that a ProductVariant is tied to another product, and so carries both the superordinate product's ProductId, as well as its own VariantId. The Data Dictionary for ProductVariants, however, is identical to a non-variant Product, and should contain the same kind of data that you want to be used for search and recommendation purposes.

A subset of the data inserted in the ProductVariant Data Dictionary can be selected as Specification data through the Search Index configuration for variants. Specifications are designed to identify the dimensions of a variant product, such as size, color, vintage etc. Specifically, Specifications are designed to correlate between products, allowing for cross-referencing on the basis of variant-specific data.

Example of Specifications Usecase

A User is looking at a Red shirt in size Medium. Specifications allows Relewise to recommend the User other shirts of the same color and size, ensuring that they are more likely to find a product that fits what they want to buy.

Content Data

Content data covers your content pages, such as blogs, articles, support pages etc. Integrating this data into Relewise allows it to be presented in your user's searches or recommendations, similar to how it is done for products.

Content Data can contain a number of different types of data depending on what you need. When importing data to Relewise, consider what is the least amount of fields you can import, and forego the rest.

  • Should the field be text searchable?
  • Should results be able to be filtered on the basis of this field?
  • Should results be able to be sorted on the basis of this field?
  • Is the field necessary for facetting?
  • Is the field necessary for boost/bury rules or similar Merchandising rules?
  • Do you need this field to be returned in results from Relwise (e.g. for displaying on the website)?

If you can answer yes to at least one of these, the field should be included. Otherwise, leave it out.

Categories

In Relewise, categories are self-living entities similar to products and content. Typically, categories are created during the import of products and content pages, where you can specify the category of each entity using the CategoryPaths data field. With category paths specified on the entities, Relewise is able to create the categories and their respective hierarchical structures automatically.

Since searching is rarely relevant for Categories themselves, the most typical data for categories is simply an Id and a DisplayName. However, categories can theoretically contain as much data as any other entity, should it be relevant.

Click here for examples on importing Categories

Example of importing multiple CategoryPaths on a Product via API

If you import your entities via the API, make sure to use a Multilingual value, to ensure that the DisplayName fields are properly searchable.

csharp
product.CategoryPaths.Add(new CategoryPath(
	new CategoryNameAndId("4", new Multilingual(
        new Multilingual.Value(english, "Audio"))),
	new CategoryNameAndId("8", new Multilingual(
        new Multilingual.Value(english, "Headphones"))),
	new CategoryNameAndId("16", new Multilingual(
        new Multilingual.Value(english, "Ear Buds")))
));
product.CategoryPaths.Add(new CategoryPath(
    new CategoryNameAndId("2", new Multilingual(
        new Multilingual.Value(english, "Smartphones"))),
	new CategoryNameAndId("74", new Multilingual(
        new Multilingual.Value(english, "Accessories")))
));

Example of importing multiple CategoryPaths via Product Feed

When importing products via a Google Product Feed, be aware that Google only allows 5 repeated fields of prouct_type per product.

<g:product_type>Audio > Headphones > Ear Buds</g:product_type>
<g:product_type>Smartphones > Accessories</g:product_type>

Often, you will want to use Categories for faceting or filtering. For instance, you may want to filter results so that you only get products that are contained within a certain category to make a category page.

csharp
var request = new ProductSearchRequest(
    new Language("da-dk"), new Currency("dkk"), 
    User.Anonymous(), null, null, 0, 10);

    request.Filters.Add(new ProductCategoryIdFilter("8", CategoryScope.Ancestor));

Category information can furthermore be accessed directly from Products and Content as a part of its display properties if you specify that a request should return this. You can access the PathFromRoot from any of the CategoryPaths that will be a part of the ProductResults to get the breadcrumbs to that product.

Be aware that moving categories or moving entities within/between categories can prove tricky, because the relation between entity and category is maintained across changes. This means that if an entity is moved permanently from one category to another (or simply removed from a category), it requires an explicit decoupling of the category from the entity. In other words, the entity's relationship to its individual categories must be restated in its entirety to ensure that the removed category is properly removed.

Data Types

Relewise supports a number of different data value types, namely: String, StringList, Double, DoubleList, Boolean, BooleanList, Multilingual, MultilingualCollection, Multicurrency, Object, and ObjectList.

For optimal performance and to minimize bugs during your implementation, ensure that you are using the right data type for each datakey. Consult the list below for usecase examples, or reach out to us for help.

Click to View Data Types Supported by Relewise

String Data

Use string data for any texts that are not language-specific, and which do not require natural language processing in the interaction with the search. For language-specific texts that you want your users to search for, use Multilingual data or MultilingualCollection data instead.

Use Case Example

You want to attach a Product URL to the Relewise data, so you can retrieve it at a later time during or after the search.

Example of String Data

csharp
product.Data["ProductUrl"] = "https://example.com/shop/product/19782-this-is-a-product.html";

 

StringList Data

Use StringList for any field where you require a list of strings that are not language-specific. If the strings are language-specific, and/or you expect to employ natural language processing in the search for these strings, use MultilingualCollection instead.

Use Case Examples

You want to append a list of product IDs that are compatible with the product being shown, so you can retrieve it at a later time.

Example of StringList Data

csharp
product.Data["CompatibleWithProducts"] = new string[]{"p1", "p2", "p3"};

 

Double Data

Use Double data values to store numbers or values, particularly those used to faceting or for use in mathematical operations.

Use Case Examples

You want to emphasize products with a certain in-stock threshold, so you add StockCountto the product in order to set up a merchandising rule on the basis of stock count.

Example of Double Data

csharp
product.Data["StockCount"] = 19;

 

DoubleList Data

Use DoubleList data when you have multiple numeric data points for a given entity.

Use Case Examples

You retail containers for liquid, and want to detail the different sizes that a product comes in.

Example of DoubleList Data

csharp
product.Data["CompatibleVolumesInLiters"= new double[] { 124510 };

 

Boolean Data

Boolean data is mainly for fields used in merchandising or faceting.

Use Case Examples

You want to hide or bury products that are out of stock, so you add InStock as a Boolean field in order to set up a merchandising rule.

Example of Boolean Data

csharp
product.Data["InStock"] = True;

 

BooleanList Data

Use BooleanList data for when your products have a number of true/false conditions. It is primarily a tool for merchandising or faceting.

Example of BooleanList Data

csharp
product.Data["BooleanListProperty"= new bool[] { truefalsefalsetruetrue };

 

Multilingual Data

Multilingual data is used to contain language-specific strings that you want to be directly searchable by your users, such as Product Title, Description etc.

Use of Multilingual data ensures that Relewise performs natural language processing such as stemming and decompounding to the search, ensuring better results. Even for sites with a single language, the use of Multilingual Variables is encouraged.

Use Case Examples

You want your users to be able to search for the description of a product, so you set up Description as a Multilingual field.

Example of Multilingual Data

csharp
product.Data["Description"] = new Multilingual(
    new Multilingual.Value(english, "The short english description")
    );

 

MultilingualCollection Data

Use MultilingualCollection data when you have a field that contains a series of language-specific strings that you want to be directly searchable by your users.

Use of Multilingual data ensures that Relewise performs natural language processing such as stemming and decompounding to the search, ensuring better results. Even for sites with a single language, the use of Multilingual Variables is encouraged.

Use Case Examples

You have a site in English and in German, and you want to present your users with localized search and recommendation results.

Example of MultilingualCollection Data

csharp
product.Data["ShortDescription"] = new Multilingual(
    new Multilingual.Value(new Language("en"),
        "The short english description")
    new Multilingual.Value(new Language("ge"),
        "Die kurze deutsche Beschreibung")
    );

 

Multicurrency Data

Price data is stored as MultiCurrency data, which contains a string describing the name of the currency, and a double type data containing the price itself. Even when your site only uses a single currency, you should strive to employ MultiCurrency data.

Use Case Example

You have multiple currencies on your site, and want to display the correct currency according to your users' preference.

Example of Multicurrency Data

csharp
product.Data["InstallationPrice"] = new MultiCurrency(
    new Money(new Currency("DKK"), 300),
    new Money(new Currency("EUR"), 40)
);

 

Object and ObjectList

Use Objects to store different types of data that you want returned together in a request. An ObjectList can be useful for storing lists of data that you want to present together, and is commonly used for faceting.

Use Case Examples

You have a list of physical stores, and want to allow your users to sort a product by the amount in stock in a certain store. So you make an ObjectList with storeId and stockAmount in each object.

Example of an ObjectList

csharp
product.Data["Stores"] = new DataObject[] {
     new DataObject(new Dictionary<string, DataValue?>() {
        ["StoreId"] = "Store1",
        ["StockCount"] = 203,
        ["ConnectedWarehouses"] = new double[] { 1, 9, 22 } }),
     new DataObject(new Dictionary<string, DataValue?>() {
        ["StoreId"] = "Store2",
        ["StockCount"] = 53,
        ["ConnectedWarehouses"] = new double[] { 3, 2, 20 } }) 
    };

 

After integrating your entity data, you can find it in the Entities section of MyRelewise.

Making Entities Searchable

Once your entities are imported into Relewise, it is important to remember to configure the Search Index with the chosen data fields. By default, a blank Search Index will only return hits on Id and DisplayName for Products, Variants, and Content Pages. Please refer to our in-depth guide for configuring the Search Index for a detailed walkthrough of the system.

Pushing and Pulling Data to Relewise

When integrating your entities into Relewise, consider the method by which you wish to do so. You can choose to either Push data via our API, or have Relewise Pull data from a product- or content feed.

Pushing Data to Relewise via API

Pushing data via the API is the recommended method of providing entity Data to Relewise.

Doing so offers you greater control of the data flowing into the system, is faster, and is potentially cheaper in licensing costs. Any time you need to update your entities with new data keys for use in your search and recommendations, it is made easier with the Push approach, since you control the exact detail of what is being sent to Relewise.

Any time you need to update your entities with new data keys for use in your search and recommendations, it is made easier with the Push approach, since you control the exact detail of what is being sent to Relewise.

Pulling Data to Relewise via Feed

Pulling data via a Feed entails providing Relewise with a data feed, from which we then retrieve data at regular, agreed-upon intervals. As a result, this imparts a delay between when entities are updated in your feed, and when they are updated in Relewise.

Relewise innately supports RSS 2.0 feeds, e.g. Google Shopping feed, as well as Shopify feeds. Other custom feeds can also be used, but will require billed work on our part to build the integration to consume your custom feed.

If you are interested in integrating your custom feed, please contact us for an estimate of time and cost to do so.

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com