Examine Manager
Accessing the singleton can be done by using dependency injection.
In a class you can inject the IExamineManager interface:
using Examine;
namespace MyCustomUmbracoSolution;
public class MyClass
{
private readonly IExamineManager _examineManager;
public MyClass(IExamineManager examineManager)
{
_examineManager = examineManager;
}
}In a view the IExamineManager can be injected as well:
@inject IExamineManager ExamineManager;This returns an active instance of the ExamineManager which exposes operations such as:
Default index & search providers
Full collection of index & search providers
All indexing and searching methods
Searching
Important to note that the Search methods on the ExamineManager will call the Search methods of the default search provider specified in config. If you want to search using a specific provider, there are generally two approaches for this.
If you want to use the searcher of a specific index, you should get the the searcher via the index:
If you have configured a custom searcher that you wish to use instead, you can access the searcher directly via the IExamineManager instance:
An example using a custom searcher is below:
Indexing
When you wanna populate an index, you will need to use the IExamineManager and get the specific index. The build-in index names are all available as constants from the Umbraco.Cms.Core.Constants.UmbracoIndexes namespace
The indexing methods available on a single index are:
Last updated
Was this helpful?