GenerateLunrIndex Class
Namespace
Statiq.Lunr
Interfaces
Base Types
graph BT Type-->Base0["Module"] click Base0 "/api/Statiq.Common/Module" Base0-->Base1["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type["GenerateLunrIndex"] class Type type-node

Syntax

public class GenerateLunrIndex : Module, IModule

Fields

Name Field Type Constant Value Summary
DefaultClientName string
static
DefaultFields IReadOnlyDictionary<string, FieldType>
static
DefaultReferenceKey string
static
DefaultScriptPath NormalizedPath
static

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
AllowPositionMetadata(bool) GenerateLunrIndex
Adds the "position" metadata to the metadata allowlist in the search index, which enables position information for each search term in the search results at the expense of index size.
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
CustomizeScript(Func<string, IExecutionContext, string>) GenerateLunrIndex
This allows you to customize the JavaScript file that this module creates.
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from Module
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
IncludeHostInLinks(bool) GenerateLunrIndex
Indicates whether the host should be automatically included in generated links (the default is false).
RemoveHtml(bool) GenerateLunrIndex
Indicates whether HTML should be removed from document content when the input document media type indicates the content is HTML (the default is true).
WithClientName(string) GenerateLunrIndex
Changes the name of the client object in the generated JavaScript file.
WithField(string, FieldType) GenerateLunrIndex
Defines a search field and whether to include it in results.
WithFields(IEnumerable<KeyValuePair<string, FieldType>>) GenerateLunrIndex
Defines search fields and whether to include them in results.
WithIndexPath(NormalizedPath) GenerateLunrIndex
Controls the output path of the search index file (by default the destination of the search index file is the same as the script file with a ".index.gz" extension, or ".index.json" extension if ZipIndexFile(bool) is false). or ).
WithoutAnyFields() GenerateLunrIndex
Clears all fields from the search index.
WithoutField(string) GenerateLunrIndex
Removes a field from the search index.
WithReferenceKey(string) GenerateLunrIndex
Sets an alternate reference key that will be used to get a unique identifier for each search metadata item.
WithResultsPath(NormalizedPath) GenerateLunrIndex
Controls the output path of the results file that holds search field values as defined by Result (by default the destination of the search index file is the same as the script file with a ".results.json" extension).
WithScriptPath(NormalizedPath) GenerateLunrIndex
Controls the output path of the script file (by default the destination of the script file is "search.js").
WithSearchItems(Config<IEnumerable<IEnumerable<KeyValuePair<string, object>>>>) GenerateLunrIndex
Use a custom delegate to get search items for each input document. Only the reference and search field keys will be retrieved from the returned item(s), all other values will be ignored (I.e. they won't be added to the search automatically).
WithSearchItemsKey(string) GenerateLunrIndex
Sets a custom metadata key to use to get search items from each document if the document provides search items via metadata.
WithStemming(bool) GenerateLunrIndex
Turns on stemming, which reduces words to their base form, using a default English stemmer. You can customize stemming and supply a stemming delegate using WithStemming(Func<string, string>). Note that turning on stemming reduces the effectiveness of wildcard searches and disables the default client-side typeahead search behavior in the generated JavaScript file.
WithStemming(Func<string, string>) GenerateLunrIndex
Turns on stemming, which reduces words to their base form, using a custom stemming delegate. Note that turning on stemming reduces the effectiveness of wildcard searches and disables the default client-side typeahead search behavior in the generated JavaScript file.
WithStopWords(Config<IEnumerable<string>>) GenerateLunrIndex
Specifies stops words to use for the search index. By default a pre-defined set of English stop words are used.
WithStopWordsFromFile(NormalizedPath) GenerateLunrIndex
Specifies an input file that contains stop words to use. The file should contain one stop word per line.
ZipIndexFile(bool) GenerateLunrIndex
Indicates whether to gzip the index file (the default is true).
ZipResultsFile(bool) GenerateLunrIndex
Indicates whether to gzip the results file (the default is true).

Extension Methods