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, Analyzer)

Constructor to allow for creating an indexer at runtime

[Obsolete("To remove in Examine V5")]
protected BaseLuceneSearcher(string name, Analyzer analyzer)

Parameters

name string
analyzer Analyzer

BaseLuceneSearcher(string, Analyzer, FacetsConfig)

Constructor to allow for creating an indexer at runtime

protected BaseLuceneSearcher(string name, Analyzer analyzer, FacetsConfig facetsConfig)

Parameters

name string
analyzer Analyzer
facetsConfig FacetsConfig

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.

[Obsolete("The virutal modifier will be removed in Examine V5, override Dispose(bool) instead")]
public virtual void Dispose()

Dispose(bool)

Disposes of the searcher

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GetDefaultFacetConfig()

Gets a FacetConfig with default configuration

[Obsolete("To remove in Examine V5")]
public virtual FacetsConfig GetDefaultFacetConfig()

Returns

FacetsConfig

Facet Config

GetSearchContext()

Gets the seach 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