Is it possible to use one index as the base for another index?
public class BlogPostsOrderedByCreated : AbstractIndexCreationTask<BlogPost, BlogPost> {
/* Ordering Blogs after creation-date */
}
// TODO: Implement another index that uses above index
//public class BlogSelection :
Is this even possible or do I have to create a totally new index that duplicates the other index’s code? If not possible, then why?
No, you cannot do that because it’s very complex to implement this and the value in exchange in minimal.
It’s complex to implement this because of:
– You should be notifying in the second index when there is any changed in the first index.
– How do you implement transactions?
And there is probably more. The dependably between the indexes will raise some really complex issue to solve, so you better have just two indexes.
If this not make sense in your scenario you may have been doing something the wrong way. For example, you don’t have to create any BlogPostsOrderedByCreated and BlogSelection indexes, use just a linq query that will do both: