Class IndexingService
java.lang.Object
org.ctan.site.services.search.base.IndexingBase
org.ctan.site.services.search.base.IndexingService
The class
SearchService
implements a service to perform a
full-text search.-
Constructor Summary
ConstructorsConstructorDescriptionIndexingService
(File base) This is the constructor forIndexingService
.This is the constructor for the classIndexingService
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
clearIndexDir
(IndexType type) Remove all files in the index directory.protected org.apache.lucene.index.IndexWriter
createWriter
(IndexType type, String locale) Create an index writer.The methodindexingSession
provides means to open a new indexing session.void
initializeIndices
(IndexingStore... stores) This method iterates through all index types and creates the associated index.Methods inherited from class org.ctan.site.services.search.base.IndexingBase
checkIndexDirectory, directory, indexPath, open, open
-
Constructor Details
-
IndexingService
This is the constructor forIndexingService
.- Parameters:
base
- the base directory for the search index
-
IndexingService
This is the constructor for the classIndexingService
.- Parameters:
config
- the index configuration- Throws:
FileNotFoundException
- in case that one of the index directories does not exist
-
-
Method Details
-
clearIndexDir
Remove all files in the index directory.- Parameters:
type
- the index type- Returns:
true
iff the directory and the files contained could be deleted
-
createWriter
protected org.apache.lucene.index.IndexWriter createWriter(IndexType type, String locale) throws org.apache.lucene.index.CorruptIndexException, IOException Create an index writer.- Parameters:
type
- the index typelocale
- the language code- Returns:
- the new index writer
- Throws:
org.apache.lucene.index.CorruptIndexException
- in case of a problem with the indexIOException
- in case of an I/O error
-
indexingSession
The methodindexingSession
provides means to open a new indexing session.- Returns:
- the new indexing session
- Throws:
FileNotFoundException
- if the file is not found
-
initializeIndices
public void initializeIndices(IndexingStore... stores) throws org.apache.lucene.index.CorruptIndexException, IOException This method iterates through all index types and creates the associated index.- Parameters:
stores
- the array of stores to use for indexing- Throws:
IOException
- in case of an I/O errororg.apache.lucene.index.CorruptIndexException
- in case of an error
-