Also, "multiple vs single index" question is a rather hot topic, see the following discussion, for example: http://stackoverflow.com/questions/2746568/multiple-or-single-index-in-lucene
When you don't want to index just everything, it would be great to be able to choose which templates you want to index and leave the rest of the data out instead of manually excluding hundreds of templates. Unfortunately, it is not supported out of the box, even though there are some unused methods / properties for "list:IncludeTemplates" functionality. But it can be achieved by customizing the LuceneIndexConfiguration class and the following trick - you can put all templates to "Exclude Templates", except the ones that are added to "Include Templates".
Step 1. Compile the following code:
Step 2. Replace Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration with %your namespace%.ExtendedIndexConfiguration in your index config.
Step 3. Configure templates you wan to index in a following way:
I've managed to reduce index size from 500mb to ~12mb and increase index rebuild speed by up to 15 times by using this trick. Such functionality will be probably implemented in the future versions of CMS, so do not forget to check it if you're using any version newer than 7.0 RTM.
No comments:
Post a Comment