Indexing custom POCO

Mark Entius
Member since: 2011
 

Hi,

I'm trying to index a custom POCO instead of variants for performance reasons. When following the guid at: https://world.episerver.com/documentation/Items/Developers-Guide/Episerver-Commerce/9/Search/find-integration/indexing-poco-objects-instead-of-catalogcontentbase/ it says to disable indexing of CatalogContentBase and to override CatalogContentEventListener actions.

This is weird because if I disable the indexing of CatalogContentBase the action methods will never be hit and my custom POCOs won't be indexed either. 
So this looks like a catch-22. I can't disable indexing of variants and when not disabling it's indexing both variant and POCO?

Does anyone have experience with indexing POCO's?

PS.

I'm trying this because of the number of results that we're returning from a query (aprox 900 items) and the default implementation loads the Variant from the database (slow) even when using projections! 

/Mark

#189564 Mar 20, 2018 16:40
  • Drew Null
    Member since: 2013
     

    I am not familiar with this technique, but some thoughts... 

    • In this example, disabling the indexing of CatalogContentBase will disable the indexing of all catalog types: Nodes (categories), Products, and Variants -- not just Variants. Because...
    • ForInstancesOf<T>() applies to the specified type and all derived types. You can use ForType<T>() to target a specific type

    What if you skip the CatalogContentBase index disabling and allow Find to index both the Variant and the POCO? And then only search against the POCOs? Something like... 

    var search = findClient.Search<MyPocoClass>().For("whatever").GetResults();

    Correct? Does it matter whether Variants are getting indexed too?

    #190609 Apr 12, 2018 17:26