I am trying to programmatically create indexes corresponding to several types, so I can search for elements of a certain type in my controllers. (I tried using the type keyword in Lucene, but that doesn't seem to work at all no matter what I do, so I changed my approach.)
However, I cannot understand how to tell Orchard about the inclusion of a certain type in the index during the migration process. I tried using:
var typeIndexing = ContentDefinitionManager.GetTypeDefinition(contentType) .Settings.GetModel<TypeIndexing>(); typeIndexing.List = typeIndexing.List.Concat(indexName.Yield()).ToArray();
but this returns null as a result of GetTypeDefinition() .
I use:
ContentDefinitionManager.AlterTypeDefinition(contentType, builder => { builder.WithSetting("TypeIndexing.Indexes", indexName); });
but it looks like it replaces the previous configured index, if it works at all ( EDIT: nope), and I don't want to compress the existing settings. (The other person on the team is processing our recipe settings.)
Is there a place where I could touch this setting and save it and actually use Orchard outside the recipe file?
To illustrate what I'm trying to accomplish using similar changes to the admin user interface, under Content Definition> [Content Type Name]> Change :
Front

After:

source share