Table of Contents

Class BaseLuceneSearcher

Namespace
Examine.Lucene.Providers
Assembly
Examine.Lucene.dll

Simple abstract class containing basic properties for Lucene searchers

public abstract class BaseLuceneSearcher : BaseSearchProvider, ISearcher, IDisposable
Inheritance
BaseLuceneSearcher
Implements
Derived
Inherited Members

Constructors

BaseLuceneSearcher(string, IOptionsMonitor<LuceneSearcherOptions>)

Constructor to allow for creating an indexer at runtime

protected BaseLuceneSearcher(string name, IOptionsMonitor<LuceneSearcherOptions> options)

Parameters

name string
options IOptionsMonitor<LuceneSearcherOptions>

Properties

LuceneAnalyzer

The analyzer to use for query parsing, by default, this is set to StandardAnalyzer

public Analyzer LuceneAnalyzer { get; }

Property Value

Analyzer

Methods

CreateQuery(string?, BooleanOperation)

Creates a search criteria instance as required by the implementation

public override IQuery CreateQuery(string? category = null, BooleanOperation defaultOperation = BooleanOperation.And)

Parameters

category string

The type of data in the index.

defaultOperation BooleanOperation

The default operation.

Returns

IQuery

An instance of IQueryExecutor

CreateQuery(string?, BooleanOperation, Analyzer, LuceneSearchOptions)

Creates an instance of SearchCriteria for the provider

public IQuery CreateQuery(string? category, BooleanOperation defaultOperation, Analyzer luceneAnalyzer, LuceneSearchOptions searchOptions)

Parameters

category string

The type of data in the index.

defaultOperation BooleanOperation

The default operation.

luceneAnalyzer Analyzer
searchOptions LuceneSearchOptions

Returns

IQuery

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public abstract void Dispose()

GetSearchContext()

Gets the search context

public abstract ISearchContext GetSearchContext()

Returns

ISearchContext

Search(string, QueryOptions?)

Searches the index

public override ISearchResults Search(string searchText, QueryOptions? options = null)

Parameters

searchText string

The search text or a native query

options QueryOptions

Returns

ISearchResults

Search Results