Area: Episerver Commerce
Applies to versions: 10 and higher
Other versions:

Index POCO objects instead of CatalogContentBase

Recommendations [hide]

This topic describes how to index POCO (Plain Old CLR Objects) objects instead of catalog content inheriting from CatalogContentBase. These examples apply to solutions with the Episerver Search & Navigation-Commerce integration (EPiServer.Find.Commerce) installed.

Excluding CatalogContentBase from being indexed

Creating a POCO class and indexing it in Search & Navigation is easy. The problem is to figure out how to reindex objects when catalog content changes. We can make sure that nothing that inherits from CatalogContentBase gets indexed.

Adding default price, prices, and inventory

Add properties to your POCO class that fits your needs. These are three examples: IEnumerable<Price> Prices, Price DefaultPrice, and IEnumerable<Inventories>. These properties can be populated by using ReadonlyPriceLoader and InventoryLoader.

Listening for updates

You can override methods that return a delegate for indexing content. We can create POCO objects and index them.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Oct 24, 2016

Recommendations [hide]