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
loggerFactoryILoggerFactorynamestringindexOptionsIOptionsMonitor<IndexOptions>
Properties
FieldDefinitions
Returns the field definitions for the index
public ReadOnlyFieldDefinitionCollection FieldDefinitions { get; }
Property Value
LoggerFactory
The factory used to create instances of ILogger.
protected ILoggerFactory LoggerFactory { get; }
Property Value
Name
The index name
public virtual string Name { get; }
Property Value
Searcher
Returns a searcher for the index
public abstract ISearcher Searcher { get; }
Property Value
ValueSetValidator
A validator to validate a value set before it's indexed
public IValueSetValidator? ValueSetValidator { get; }
Property Value
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
itemIdsIEnumerable<string>Node to delete
IndexExists()
determines whether the index exsists or not
public abstract bool IndexExists()
Returns
IndexItems(IEnumerable<ValueSet>)
Validates the items and calls PerformIndexItems(IEnumerable<ValueSet>, Action<IndexOperationEventArgs>)
public void IndexItems(IEnumerable<ValueSet> values)
Parameters
valuesIEnumerable<ValueSet>
OnIndexOperationComplete(IndexOperationEventArgs)
Run when a index operation completes
protected void OnIndexOperationComplete(IndexOperationEventArgs e)
Parameters
OnIndexingError(IndexingErrorEventArgs)
Raises the IndexingError event.
protected virtual void OnIndexingError(IndexingErrorEventArgs e)
Parameters
eIndexingErrorEventArgsThe IndexingErrorEventArgs instance containing the event data.
OnTransformingIndexValues(IndexingItemEventArgs)
Raises the TransformingIndexValues event.
protected virtual void OnTransformingIndexValues(IndexingItemEventArgs e)
Parameters
eIndexingItemEventArgsThe 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
itemIdsIEnumerable<string>onCompleteAction<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
valuesIEnumerable<ValueSet>onCompleteAction<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
itemValueSet
Returns
Events
IndexOperationComplete
Raised once an index operation is completed
public event EventHandler<IndexOperationEventArgs>? IndexOperationComplete
Event Type
IndexingError
Occurs for an Indexing Error
public event EventHandler<IndexingErrorEventArgs>? IndexingError
Event Type
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