Table of Contents

Class BaseIndexProvider

Namespace
Examine
Assembly
Examine.Core.dll

Base class for an Examine Index Provider

public abstract class BaseIndexProvider : IIndex
Inheritance
BaseIndexProvider
Implements
Derived
Inherited Members
Extension Methods

Constructors

BaseIndexProvider(ILoggerFactory, string, IOptionsMonitor<IndexOptions>)

Constructor for creating an indexer at runtime

protected BaseIndexProvider(ILoggerFactory loggerFactory, string name, IOptionsMonitor<IndexOptions> indexOptions)

Parameters

loggerFactory ILoggerFactory
name string
indexOptions IOptionsMonitor<IndexOptions>

Properties

FieldDefinitions

Returns the field definitions for the index

public ReadOnlyFieldDefinitionCollection FieldDefinitions { get; }

Property Value

ReadOnlyFieldDefinitionCollection

LoggerFactory

The factory used to create instances of ILogger.

protected ILoggerFactory LoggerFactory { get; }

Property Value

ILoggerFactory

Name

The index name

public virtual string Name { get; }

Property Value

string

Searcher

Returns a searcher for the index

public abstract ISearcher Searcher { get; }

Property Value

ISearcher

ValueSetValidator

A validator to validate a value set before it's indexed

public IValueSetValidator? ValueSetValidator { get; }

Property Value

IValueSetValidator

Methods

CreateIndex()

Creates a new index, any existing index will be deleted

public abstract void CreateIndex()

DeleteFromIndex(IEnumerable<string>)

Deletes a node from the index

public void DeleteFromIndex(IEnumerable<string> itemIds)

Parameters

itemIds IEnumerable<string>

Node to delete

IndexExists()

determines whether the index exsists or not

public abstract bool IndexExists()

Returns

bool

IndexItems(IEnumerable<ValueSet>)

public void IndexItems(IEnumerable<ValueSet> values)

Parameters

values IEnumerable<ValueSet>

OnIndexOperationComplete(IndexOperationEventArgs)

Run when a index operation completes

protected void OnIndexOperationComplete(IndexOperationEventArgs e)

Parameters

e IndexOperationEventArgs

OnIndexingError(IndexingErrorEventArgs)

Raises the IndexingError event.

protected virtual void OnIndexingError(IndexingErrorEventArgs e)

Parameters

e IndexingErrorEventArgs

The IndexingErrorEventArgs instance containing the event data.

OnTransformingIndexValues(IndexingItemEventArgs)

Raises the TransformingIndexValues event.

protected virtual void OnTransformingIndexValues(IndexingItemEventArgs e)

Parameters

e IndexingItemEventArgs

The IndexingItemEventArgs instance containing the event data.

PerformDeleteFromIndex(IEnumerable<string>, Action<IndexOperationEventArgs>)

Deletes an index item by id

protected abstract void PerformDeleteFromIndex(IEnumerable<string> itemIds, Action<IndexOperationEventArgs> onComplete)

Parameters

itemIds IEnumerable<string>
onComplete Action<IndexOperationEventArgs>

Called by the implementor once the items have been indexed

PerformIndexItems(IEnumerable<ValueSet>, Action<IndexOperationEventArgs>)

Indexes the items in the ValueSet

protected abstract void PerformIndexItems(IEnumerable<ValueSet> values, Action<IndexOperationEventArgs> onComplete)

Parameters

values IEnumerable<ValueSet>
onComplete Action<IndexOperationEventArgs>

Called by the implementor once the items have been indexed

Remarks

Items will have been validated at this stage

ValidateItem(ValueSet)

Ensures that the node being indexed is of a correct type

protected ValueSetValidationResult ValidateItem(ValueSet item)

Parameters

item ValueSet

Returns

ValueSetValidationResult

Events

IndexOperationComplete

Raised once an index operation is completed

public event EventHandler<IndexOperationEventArgs>? IndexOperationComplete

Event Type

EventHandler<IndexOperationEventArgs>

IndexingError

Occurs for an Indexing Error

public event EventHandler<IndexingErrorEventArgs>? IndexingError

Event Type

EventHandler<IndexingErrorEventArgs>

TransformingIndexValues

Raised before the item is indexed allowing developers to customize the data that get's stored in the index

public event EventHandler<IndexingItemEventArgs>? TransformingIndexValues

Event Type

EventHandler<IndexingItemEventArgs>