C# Class Roadkill.Core.Services.SearchService

Provides searching tasks using a Lucene.net search index.
Inheritance: ISearchService
Afficher le fichier Open project: LocalGovDigital/pipeline Class Usage Examples

Méthodes publiques

Méthode Description
Add ( PageViewModel model ) : void

Adds the specified page to the search index.

CreateIndex ( ) : void

Creates the initial search index based on all pages in the system.

Delete ( PageViewModel model ) : int

Deletes the specified page from the search indexs.

Search ( string searchText ) : IEnumerable

Searches the lucene index with the search text.

Syntax reference: http://lucene.apache.org/java/2_3_2/queryparsersyntax.html#Wildcard

SearchService ( Roadkill.Core.Configuration.ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory ) : System
Update ( PageViewModel model ) : void

Updates the Page in the search index, by removing it and re-adding it.

Private Methods

Méthode Description
EnsureDirectoryExists ( ) : void
GetContentSummary ( PageViewModel model ) : string

Converts the page summary to a lucene Document with the relevant searchable fields.

Method Details

Add() public méthode

Adds the specified page to the search index.
An error occured with the lucene.net IndexWriter while adding the page to the index.
public Add ( PageViewModel model ) : void
model Roadkill.Core.Mvc.ViewModels.PageViewModel The page to add.
Résultat void

CreateIndex() public méthode

Creates the initial search index based on all pages in the system.
An error occured with the lucene.net IndexWriter while adding the page to the index.
public CreateIndex ( ) : void
Résultat void

Delete() public méthode

Deletes the specified page from the search indexs.
An error occured with the lucene.net IndexReader while deleting the page from the index.
public Delete ( PageViewModel model ) : int
model Roadkill.Core.Mvc.ViewModels.PageViewModel The page to remove.
Résultat int

Search() public méthode

Searches the lucene index with the search text.
Syntax reference: http://lucene.apache.org/java/2_3_2/queryparsersyntax.html#Wildcard
An error occured searching the lucene.net index.
public Search ( string searchText ) : IEnumerable
searchText string The text to search with.
Résultat IEnumerable

SearchService() public méthode

public SearchService ( Roadkill.Core.Configuration.ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory ) : System
settings Roadkill.Core.Configuration.ApplicationSettings
repository IRepository
pluginFactory IPluginFactory
Résultat System

Update() public méthode

Updates the Page in the search index, by removing it and re-adding it.
An error occured with lucene.net while deleting the page or inserting it back into the index.
public Update ( PageViewModel model ) : void
model Roadkill.Core.Mvc.ViewModels.PageViewModel The page to update
Résultat void