Examine Documentation

What is Examine?

Examine allows you to index and search data easily and wraps the Lucene.NET indexing/searching engine. Lucene is super fast and allows for very fast searching even on very large amounts of data. Examine is very extensible and allows you to configure as many indexes as you like and each may be configured individually. Out of the box Examine gives you a Lucene based index implementation as well as a Fluent API that can be used to search for your data.

Examine is installed via Nuget: https://www.nuget.org/packages/Examine

API Documentation

Autogenerated API documentation is available.

Conceptual Documentation

Conceptual documentation is available.

Not all features of Lucene.NET have Examine abstractions. See the Lucene.NET documentation for Lucene.NET specific API.

Tip: There are many unit tests in the source code that can be used as Examples of how to do things. There is also a test web project that has plenty of examples of how to configure indexes and search them.

Releases

Releases are available here and on NuGet.

Minimum requirements

Examine Version .NET
V4 .NET 8.0, .NET 9.0, .NET 10.0
V3 .NET 6.0, .NET 8.0

What's new in V4

  • Faceting - count and group the documents matching a query by field value or by numeric range, including hierarchical facets backed by a Lucene taxonomy index.
  • Taxonomy indexes - a sidecar taxonomy index for faster and hierarchical faceting, configured per index.
  • Deep paging - page through large result sets efficiently with SearchAfterOptions instead of ever-growing skip/take, and it works with faceted queries.
  • Index replication - taxonomy-aware replication, retries on transient lock failures, and IsReplicationHealthy to surface persistent commit failures.
  • Nullable reference types - enabled across the codebase with warnings treated as errors, so all public APIs are annotated.

See the v3 to v4 public API changes for the full list of additions, signature changes and removals, and the V4.0.0 release notes.

Quick Start

Tip: IExamineManager is the gateway to working with examine. It is registered in DI as a singleton and can be injected into your services.

  1. Install

    > dotnet add package Examine --version 4.0.0
    
  2. Configure Services and create an index

    // Adds Examine Core services
    services.AddExamine();
    
    // Create a Lucene based index
    services.AddExamineLuceneIndex("MyIndex");
    
  3. Populate the index

    // Add a "ValueSet" (document) to the index 
    // which can contain any data you want.
    myIndex.IndexItem(new ValueSet(
        Guid.NewGuid().ToString(),  //Give the doc an ID of your choice
        "MyCategory",               //Each doc has a "Category"
        new Dictionary<string, object>()
        {
            {"Name", "Frank" },
            {"Address", "Beverly Hills, 90210" }
        }));
    
  4. Search the index

    // Create a query
    var results = myIndex.Searcher.CreateQuery()
        .Field("Address", "Hills")        // Look for any "Hills" addresses
        .Execute();                       // Execute the search