Hi,
We have an old site that we're slowly refactoring. We reached the Repository that has some logic that no longer applies. We're using the product schema extender and have far too many query expressions and wacky grouping and logic, that make refactoring tricky.
We're starting from scratch with a new index, new fields, new query, new facets. Eventually at some point we'll simply update the paragraph app settings to point to the new query and new facet group and voilá.
My struggle now is on the IndexBuilderExtender. Because it inherits from the type of builder (ProductIndexBuilder), it will trigger for both of my indexes. Is there a way that I can identify the actual Index, so that I wrap the logic around some if statement, until such a time comes that I can delete the old code?
I am looking for something like this
public override void ExtendDocument(IndexDocument doc) { var index = HowToFindTheCurrentIndex?(); if(index == "my_old_index.index") { // Run old legacy code } else { // Run new code } }
Can this be achieve somehow?
Best Regards,
Nuno Aguiar