C# Класс Roadkill.Core.Services.SearchService

Provides searching tasks using a Lucene.net search index.
Наследование: ISearchService
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
EnsureDirectoryExists ( ) : void
GetContentSummary ( PageViewModel model ) : string

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

Описание методов

Add() публичный Метод

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.
Результат void

CreateIndex() публичный Метод

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
Результат void

Delete() публичный Метод

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.
Результат int

Search() публичный Метод

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.
Результат IEnumerable

SearchService() публичный Метод

public SearchService ( Roadkill.Core.Configuration.ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory ) : System
settings Roadkill.Core.Configuration.ApplicationSettings
repository IRepository
pluginFactory IPluginFactory
Результат System

Update() публичный Метод

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
Результат void