Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Catalog content is ignoring the Find Id I have given it

$
0
0

I am indexing products and categories in Find and using an initialisation module to set the client conventions - see below.

[InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class SearchIndexInitialization : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {           
            ContentIndexer.Instance.Conventions.ForInstancesOf<ImageFile>().ShouldIndex(x => false);
            SearchClient.Instance.Conventions.ForInstancesOf<BaseProduct>()
                .IdIs(x => x.Barcode)
                .IncludeField(x => x.InStock())
                .IncludeField(x => x.DisplayPrice());               
            SearchClient.Instance.Conventions.ForInstancesOf<BookProduct>()
                .IdIs(x => x.Barcode);
            SearchClient.Instance.Conventions.ForInstancesOf<GenericProduct>()
                .IdIs(x => x.Barcode);
            SearchClient.Instance.Conventions.ForInstancesOf<Magazine>()
                .IdIs(x => x.Barcode);
            SearchClient.Instance.Conventions.ForInstancesOf<AxNode>()
                .IdIs(x => x.Code);           
        }

However, the ID field of Barcode and Code for Nodes does not seem to be used. When I run any queries the ID still looks something like this: "CatalogContent_93c105e2-8ed7-413f-b188-450cf3ad9f14_en-US"

Note that BaseProduct is the inherited type of other products and included fields do work. I added the other derived types explicitly just in case it was an inheritance issue but that seems to have no effect.

Is the standard behaviour, a bug or I missing something?


Viewing all articles
Browse latest Browse all 6894

Trending Articles