Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@using System.Reflection
@using Sitecore.ContentSearch
@using Sitecore.ContentSearch.SolrProvider
@using Sitecore.ContentSearch.SolrProvider.Agents
<html>
<body>
Solr Status: @SolrStatus.OkSolrStatus()
<br />
Solr Last Status: @typeof(IndexingStateSwitcher).GetField("lastSolrConnectionStatus", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHierarchy).GetValue(null)
<br />
Solr Indexes
<table>
<thead>
<tr>
<th>Name</th>
<th>IsInitialized</th>
</tr>
</thead>
<tbody>
@foreach (AbstractSearchIndex index in ContentSearchManager.Indexes)
{
<tr>
<td>@index.Name</td>
<td>@index.IsInitialized</td>
@if (!index.IsInitialized)
{
index.Initialize();
}
</tr>
}
</tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.