Skip to main content
1 of 3
Teeknow
  • 2.5k
  • 14
  • 33

How Does Sitecore Decide the Index to Use with GetIndex

A new index was added to a Sitecore instance I am working on. This ended up causing a different module in the implementation to have a problem. The part having an issue uses Sitecore.ContentSearch.ContentSearchManager.GetIndex(IIndexable indexable) to get an index to use passing in the current item cast appropriately. To fix the issue I switched from passing in the current item to passing in the item that represents the homepage of the current site which did the trick since the homepage item was outside of the other index. I don't understand exactly how the index to use is determined though. How does Sitecore decide what index to use when passing in an item if that item is in multiple indexes?

Teeknow
  • 2.5k
  • 14
  • 33