Default Handlers & Pipes

Overview

This page aims to depict the default handlers and pipes found in the connector.

Handlers are the logical steps in indexing (both full and incremental indexing). A handler is given a command which it must execute. Some handlers, besides executing the command, have some internal sub-steps called pipes, which run in a specific order and help to fulfill the handler’s responsibility. Handlers together with their pipes compose an indexing chain. Think of the indexing chain as the logical flow when indexing content from your website:

  • Indexing chain
    • Handler 1
    • Handler 2
      • Pipe 2.1
      • Pipe 2.2
    • Handler 3
      • Pipe 3.1

Full Indexing Handlers

Delete Previous Index Handler

Class name: DeletePreviousIndexHandler

Base: IndexingHandlerBase

Description: Deletes the previous index from Hawksearch. This is executed only if there are already 2 indexes created in Hawksearch. It is needed because Hawksearch only allows for 2 indexes to exist at the same time.

Create Index Handler

Class name: CreateIndexHandler

Base: IndexingHandlerBase

Description: Creates a new Hawksearch index using the suffix specified in web.config (if any).

Categories Indexing Handler

Class name: CategoriesIndexingHandler where T : NodeContent

Base: IndexingHandlerBase

Description: Indexes all categories from Optimizely’s catalogs.

Pipes:

OrderPipeDescription
100CategoriesReaderPipeTraverses the catalog structure and loads all the categories
200CategoriesTransformerPipeTransforms the traversed categories into Hierarchy objects which will be sent to Hawksearch
300CategoriesRootPipeSets the ParentHierarchyId to “1” for the top-most categories under the catalog root, as required by Hawksearch
500CategoriesIndexingPipeMakes the necessary requests to the Hierarchy API in order to index the transformed categories

Entries Indexing Handler

Class name: EntriesIndexingHandler where T : EntryContentBase

Base: IndexingHandlerBase

Description: Indexes different type of entries after loading them in batches. Represented by an abstract class which ProductsIndexingHandler, VariantsIndexingHandler, BundlesIndexingHandler and PackagesIndexingHandler inherit from. The handler’s pipes are shared with its children types.

Pipes:

OrderPipeDescription
200EntriesTransformerPipeTransforms the loaded entries into Item objects which will be sent to Hawksearch
250EntriesDecoratedPropertiesPipeFurther populates the Item objects with the properties decorated with [IncludeInHawksearch] attribute
300EntriesCategoryPipeSets the categories that the entries belong to on the Item objects
600EntriesIndexingPipeMakes the necessary requests to the Indexing API in order to index the transformed items

Products Indexing Handler

Class name: ProductsIndexingHandler where T : ProductContent

Base: EntriesIndexingHandler where T : EntryContentBase

Description: Indexes products. Generic type V must be of type VariationContent for pipes.

Pipes:

OrderPipeDescription
250ProductVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent product
250ProductVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent product’s hawk_child_attributes JSON property

Variants Indexing Handler

Class name: VariantsIndexingHandler where T : VariationContent

Base: EntriesIndexingHandler where T : EntryContentBase

Description: Indexes variants. This is not available in the case of “Variant Attributes Roll Up” indexing strategy.

Pipes:

OrderPipeDescription
400VariantPriceIndexingPipeOPTIONAL Pipe. Indexes the prices for variants
500VariantInventoryIndexingPipeOPTIONAL Pipe. Indexes the inventories for variants

Bundles Indexing Handler

Class name: BundlesIndexingHandler where T : BundleContent

Base: EntriesIndexingHandler where T : EntryContentBase

Description: Indexes bundles. Generic type V must be of type VariationContent for pipes.

Pipes:

OrderPipeDescription
250BundleVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent bundle
250BundleVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent bundle’s hawk_child_attributes JSON property

Packages Indexing Handler

Class name: PackagesIndexingHandler where T : PackageContent

Base: EntriesIndexingHandler where T : EntryContentBase

Description: Indexes packages. Generic type V must be of type VariationContent for pipes.

Pipes:

OrderPipeDescription
250PackageVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent package
250PackageVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent package’s hawk_child_attributes JSON property
400PackagePriceIndexingPipeOPTIONAL Pipe. Indexes the prices for packages
500PackageInventoryIndexingPipeOPTIONAL Pipe. Indexes the inventories for packages

Pages Indexing Handler

Class name: PagesIndexingHandler where T : PageData

Base: IndexingHandlerBase

Description: Indexes CMS pages.

Pipes

OrderPipeDescription
200PagesTransformerPipeTransforms the loaded pages into Item objects which will be sent to Hawksearch
300PagesDecoratedPropertiesPipeFurther populates the Item objects with the properties decorated with [IncludeInHawksearch] attribute
500PagesIndexingPipeMakes the necessary requests to the Indexing API in order to index the transformed items

Set Current Index Handler

Class name: SetCurrentIndexHandler

Base: IndexingHandlerBase

Description: Sets the current Hawksearch index to the newly created one.

Incremental Indexing Handlers

Get Current Index Handler

Class name: GetCurrentIndexHandler

Base: IndexingHandlerBase

Description: Gets the current Hawksearch index.

Categories Incremental Indexing Handler

Class name: CategoriesIncrementalIndexingHandler where T : NodeContent

Base: IndexingHandlerBase

Description: Indexes all the changed categories.

Pipes

OrderPipeDescription
100CategoriesIncrementalReaderPipeReads from the IndexingQueue database table the changed categories
200CategoriesTransformerPipeTransforms the changed categories into Hierarchy objects which will be sent to Hawksearch
300CategoriesRootPipeSets the ParentHierarchyId to “1” for the top-most categories under the catalog root, as required by Hawksearch
500CategoriesIndexingPipeMakes the necessary requests to the Hierarchy API in order to index the transformed categories

Categories Deletion Handler

Class name: CategoriesDeletionHandler

Base: IndexingHandlerBase

Description: Deletes from the index all the removed categories.

Pipes:

OrderPipeDescription
100CategoriesDeletionReaderPipeReads from the IndexingQueue database table the removed categories which will be deleted from the index
500CategoriesDeletionPipeMakes the necessary delete requests to the Hierarchy API in order to delete the removed categories

Categories Cascade Indexing Handler

Class name: CategoriesCascadeIndexingHandler

Base: IndexingHandlerBase

Description: It processes cascading events by adding events for all entities (product/variant/bundle/package) affected by the original cascading to the custom IndexingQueue table.

E.g., moving a category is originally saved in the IndexingQueue table as a cascading event of type “hierarchycascade“. In this step, the system adds events to the IndexingQueue table for all products / variants beneath that previously moved category.

Entries Incremental Indexing Handler

Class name: EntriesIncrementalIndexingHandler where T : EntryContentBase

Base: IndexingHandlerBase

Description: Indexes different types of changed entries. Represented by an abstract class which ProductsIncrementalIndexingHandler, VariantsIncrementalIndexingHandler, BundlesIncrementalIndexingHandler and PackagesIncrementalIndexingHandler inherit from. The handler’s pipes are shared with its children types.

Pipes:

OrderPipeDescription
200EntriesTransformerPipeTransforms the loaded entries into Item objects which will be sent to Hawksearch
250EntriesDecoratedPropertiesPipeFurther populates the Item objects with the properties decorated with [IncludeInHawksearch] attribute
300EntriesCategoryPipeSets the categories that the entries belong to on the Item objects
600EntriesIndexingPipeMakes the necessary requests to the Indexing API in order to index the transformed items

Products Incremental Indexing Handler

Class name: ProductsIncrementalIndexingHandler where T : ProductContent

Base: EntriesIncrementalIndexingHandler where T : EntryContentBase

Description: Indexes changed products. Generic type V must be of type VariationContent for pipes.

Pipes:

OrderPipeDescription
250ProductVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent product
250ProductVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent product’s hawk_child_attributes JSON property

Variants Incremental Indexing Handler

Class name: VariantsIncrementalIndexingHandler where T : VariationContent

Base: EntriesIncrementalIndexingHandler where T : EntryContentBase

Description: Indexes changed variants. This is not available in the case of “Variant Attributes Roll Up” indexing strategy.

Pipes:

OrderPipeDescription
400VariantPriceIndexingPipeOPTIONAL Pipe. Indexes the prices for variants
500VariantInventoryIndexingPipeOPTIONAL Pipe. Indexes the inventories for variants

Bundles Incremental Indexing Handler

Class name: BundlesIncrementalIndexingHandler where T : BundleContent

Base: EntriesIncrementalIndexingHandler where T : EntryContentBase

Description: Indexes changed bundles. Generic type V must be of type VariationContent for pipes.

Pipes:

OrderPipeDescription
250BundleVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent bundle
250BundleVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent bundle’s hawk_child_attributes JSON property

Packages Incremental Indexing Handler

Class name: PackagesIncrementalIndexingHandler where T : PackageContent

Base: EntriesIncrementalIndexingHandler where T : EntryContentBase

Description: Indexes changed packages. Generic type V must be of type VariationContent for pipes.

Pipes

OrderPipeDescription
250PackageVariantsPropertiesPipe<T,V>OPTIONAL Pipe. Rolls up the attributes decorated with [IncludeInHawksearch] of the variants inside the parent package
250PackageVariantsChildrenPipe<T, V>OPTIONAL Pipe. Adds the attributes decorated with [IncludeInHawksearch] of the variants to the parent package’s hawk_child_attributes JSON property
400PackagePriceIndexingPipeOPTIONAL Pipe. Indexes the prices for packages
500PackageInventoryIndexingPipeOPTIONAL Pipe. Indexes the inventories for packages

Pages Incremental Indexing Handler

Class name: PagesIncrementalIndexingHandler where T : PageData

Base: IndexingHandlerBase

Description: Indexes changed pages.

Pipes

OrderPipeDescription
200PagesTransformerPipeTransforms the loaded pages into Item objects which will be sent to Hawksearch
300PagesDecoratedPropertiesPipeFurther populates the Item objects with the properties decorated with [IncludeInHawksearch] attribute
500PagesIndexingPipeMakes the necessary requests to the Indexing API in order to index the transformed items

Entries Deletion Handler

Class name: EntriesDeletionHandler

Base: IndexingHandlerBase

Description: Deletes from the index all the removed entries.

Pipes:

OrderPipeDescription
600EntriesDeletionPipeMakes the necessary delete requests to the Indexing API in order to delete the removed entries

Pages Deletion Handler

Class name: PagesDeletionHandler

Base: IndexingHandlerBase

Description: Deletes from the index all the removed pages.

Pipes:

OrderPipeDescription
500PagesDeletionPipeMakes the necessary requests to the Indexing API in order to delete the removed pages

Common Handlers

Handlers used both for full and incremental indexing

Hierarchy Rebuild Handler

Class name: HierarchyRebuildHandler

Base: IndexingHandlerBase

Description: Rebuilds the Hawksearch hierarchy after organizing the categories.

Rebuild Index Handler

Class name: RebuildIndexHandler

Base: IndexingHandlerBase

Description: Rebuilds the Hawksearch index after adding items.