org.sakaiproject.search.index.impl
Class FSIndexStorage

java.lang.Object
  extended by org.sakaiproject.search.index.impl.BaseIndexStorage
      extended by org.sakaiproject.search.index.impl.FSIndexStorage
All Implemented Interfaces:
Diagnosable, IndexStorage

public class FSIndexStorage
extends BaseIndexStorage

A local only filestore implementation. This is a simple IndexImplementation that performs all its indexing in a single, unoptimized segment on the local filesystem To set the location use location@org.sakaiproject.search.api.SearchService.LocalIndexStorage in sakai.properties Check that the bean name is correct in the spring components.xml file

Author:
ieb

Field Summary
protected  boolean recoverCorruptedIndex
           
protected  String searchIndexDirectory
           
 
Fields inherited from class org.sakaiproject.search.index.impl.BaseIndexStorage
diagnostics
 
Constructor Summary
FSIndexStorage()
           
 
Method Summary
 boolean centralIndexExists()
          A fast method that checks if the index exists in the cluster without opening or loading the index.
 void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
          This will close the index reader and release any locks
 void closeIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
           
 void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
          this will close the index reader and release any locks
protected  boolean doIndexRecovery()
           
 void doPostIndexUpdate()
          perform all operations necessary after an update cycle
 void doPreIndexUpdate()
          perform all operations before an update cycle
 org.apache.lucene.index.IndexReader getIndexReader()
          get an Index Reader for the IndexStorage type
protected  org.apache.lucene.search.IndexSearcher getIndexSearcher()
           
 org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
          get an index writer, and create if asked to
 long getLastUpdate()
           
 String getSearchIndexDirectory()
           
 List getSegmentInfoList()
           
 org.apache.lucene.store.Directory getSpellDirectory()
          get the spell index directory
 boolean indexExists()
          Does the index exist
 void init()
           
 boolean isMultipleIndexers()
          Returns true if its ok to allow multiple indexers to run at the same time The index storage may manage its own locks.
 boolean isRecoverCorruptedIndex()
           
 void setLocation(String location)
           
 void setRecoverCorruptedIndex(boolean recoverCorruptedIndex)
          if set to true the IndexStorageWill automatically attempt to recover a corrupted index Not all IndexStorage implementations can do this,
 
Methods inherited from class org.sakaiproject.search.index.impl.BaseIndexStorage
addReloadListener, disableDiagnostics, enableDiagnostics, fireIndexReload, forceNextReload, getAnalyzer, getAnalyzerFactory, getIndexSearcher, getLastLoad, getLastLoadTime, hasDiagnostics, removeReloadListener, setAnalyzerFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchIndexDirectory

protected String searchIndexDirectory

recoverCorruptedIndex

protected boolean recoverCorruptedIndex
Constructor Detail

FSIndexStorage

public FSIndexStorage()
Method Detail

init

public void init()

doPreIndexUpdate

public void doPreIndexUpdate()
                      throws IOException
Description copied from interface: IndexStorage
perform all operations before an update cycle

Throws:
IOException

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IOException
Description copied from interface: IndexStorage
get an Index Reader for the IndexStorage type

Returns:
Throws:
IOException

getIndexWriter

public org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
                                                   throws IOException
Description copied from interface: IndexStorage
get an index writer, and create if asked to

Returns:
Throws:
IOException

doPostIndexUpdate

public void doPostIndexUpdate()
                       throws IOException
Description copied from interface: IndexStorage
perform all operations necessary after an update cycle

Throws:
IOException

getSearchIndexDirectory

public String getSearchIndexDirectory()
Returns:
Returns the searchIndexDirectory.

getIndexSearcher

protected org.apache.lucene.search.IndexSearcher getIndexSearcher()
                                                           throws IOException
Specified by:
getIndexSearcher in class BaseIndexStorage
Returns:
Throws:
IOException

doIndexRecovery

protected boolean doIndexRecovery()
                           throws IOException
Throws:
IOException

indexExists

public boolean indexExists()
Description copied from interface: IndexStorage
Does the index exist

Returns:

isRecoverCorruptedIndex

public boolean isRecoverCorruptedIndex()
Returns:
Returns the recoverCorruptedIndex.

setRecoverCorruptedIndex

public void setRecoverCorruptedIndex(boolean recoverCorruptedIndex)
Description copied from interface: IndexStorage
if set to true the IndexStorageWill automatically attempt to recover a corrupted index Not all IndexStorage implementations can do this,

Parameters:
recoverCorruptedIndex - The recoverCorruptedIndex to set.

setLocation

public void setLocation(String location)

getLastUpdate

public long getLastUpdate()

getSegmentInfoList

public List getSegmentInfoList()

closeIndexReader

public void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
                      throws IOException
Description copied from interface: IndexStorage
This will close the index reader and release any locks

Throws:
IOException

closeIndexWriter

public void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
                      throws IOException
Description copied from interface: IndexStorage
this will close the index reader and release any locks

Throws:
IOException

isMultipleIndexers

public boolean isMultipleIndexers()
Description copied from interface: IndexStorage
Returns true if its ok to allow multiple indexers to run at the same time The index storage may manage its own locks.

Returns:

closeIndexSearcher

public void closeIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)

centralIndexExists

public boolean centralIndexExists()
Description copied from interface: IndexStorage
A fast method that checks if the index exists in the cluster without opening or loading the index. Is local, looking on local disk is enough.

Returns:

getSpellDirectory

public org.apache.lucene.store.Directory getSpellDirectory()
Description copied from interface: IndexStorage
get the spell index directory

Returns:


Copyright © 2003-2012 Sakai Project. All Rights Reserved.