Table of contents
Examine
Overview
Examine aims to give an easy, provider based, framework for producing .NET data indexers and searchers.
Examine separates the indexer from the searcher, allowing for different storage and retrieval.
Being provider based Examine allows for multiple indexers and searchers to be configured at the same time, and each are independent from each other.
Indexer
Examine has a base class which needs to be implemented for Examine to be able to pick up the implementation. This class resides at:
public abstract class Examine.Providers.BaseIndexProvider
The BaseIndexProvider has all the methods which you need to implement to provide the operations such as:
- Adding nodes to the index
- Removing nodes from the index
It also has all the events which can/ should be used for the different points of the indexers life cycle.
Full documentation for the
BaseIndexProvider can be found
here.
Searcher
Examine has a base class which needs to be implemented for Examine to be able to pick up the implementation. This class resides are:
public abstract class Examine.Providers.BaseSearchProvider
The BaseSearchProvider exposes the methods for querying an index data source:
- Search
- Creating search criteria for the fluent search API
Full documentation for the
BaseSearchProvider can be found
here.
ExamineManager
The
Examine.ExamineManager is a singleton exposure to the index and search providers which are registered in the configuration of the application. As a singleton no public contructors are available, instead all accessing is done via the read-only property
Examine.ExamineManager.Instance .
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
- These calls are passed to the default provider of the required operation
Full documentation for the
ExamineManager can be found
here.
Fluent Search API
Examine offers a fluent (chainable) search API which aims to make constructing complex searches simple. The underlying API is determined by the provider implementation, with Examine just exposing the appropriate methods.
An example of the fluent API in action is as follows:
ISearchCriteria sc = ExamineManager.Instance.CreateSearchCriteria(100 /* max record count */, IndexType.Content /* type of index to query */);
IBooleanOperation query = sc.NodeName("Examine").And().Range("createdDate", new DateTime(2010, 03, 21), new DateTime(2010, 03, 31); // will match all nodes which have the name Examine created between the 21st and the 31st March 2010).
IEnumerable<SearchResult> results = ExamineManager.Instance.Search(query.Compile()); // prepares the query to be handled by the searcher
Full documentation on the
Fluent Search API can be found
here
Examine Implementations