org.activemath.omdocjdom.index
Class AMIndex

java.lang.Object
  extended by org.activemath.omdocjdom.index.AMIndex
All Implemented Interfaces:
IndexConstants

public class AMIndex
extends Object
implements IndexConstants

A class to describe the index for searching through the content extracted from MBase and maintained by the content-update-events.

Accessors to searchers are provided.


Field Summary
 
Fields inherited from interface org.activemath.omdocjdom.index.IndexConstants
FIELDNAME_id, FIELDNAME_metadata, FIELDNAME_type, LANG_ALL, LANG_UNIVERSAL, SUBFIELDNAME_field, SUBFIELDNAME_learningContext
 
Constructor Summary
AMIndex(Subconfiguration conf)
           
 
Method Summary
 void closeWriting(boolean shouldOptimize)
           
 void commitDeletions()
           
 void deleteDocumentAtId(String id)
           
 org.apache.lucene.index.IndexReader getIndexReader()
           
static AMIndex getInstance()
           
 AMIndexSearcher getSearcher()
           
 AMIndexSearcher getSearcher(MBaseRef mbaseRef)
           
 List<String> getSupportedLanguages()
           
 org.apache.lucene.index.IndexWriter getWriter()
           
 boolean isShouldPhoneticAtStart()
           
static Map makeDefaultProps()
           
 void postContentUpdate(List removedIds, List addedIds, List changedIds)
          Called to notify content-updates which will trigger an index update after the countDownBeforeUpdate period (in milliseconds).
 void renewIndexReader()
           
 void setMBaseRef(MBaseRef mbaseRef)
           
 void startWriting()
           
 void writeDocument(MBaseID id, OJElement elt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMIndex

public AMIndex(Subconfiguration conf)
Method Detail

makeDefaultProps

public static Map makeDefaultProps()

getSearcher

public AMIndexSearcher getSearcher()

getSearcher

public AMIndexSearcher getSearcher(MBaseRef mbaseRef)

getWriter

public org.apache.lucene.index.IndexWriter getWriter()
                                              throws IOException
Throws:
IOException

postContentUpdate

public void postContentUpdate(List removedIds,
                              List addedIds,
                              List changedIds)
Called to notify content-updates which will trigger an index update after the countDownBeforeUpdate period (in milliseconds).

Parameters:
removedIds - IDs of items removed
addedIds - IDs of items added
changedIds - IDs of items changed

getSupportedLanguages

public List<String> getSupportedLanguages()

getInstance

public static AMIndex getInstance()

startWriting

public void startWriting()

closeWriting

public void closeWriting(boolean shouldOptimize)

deleteDocumentAtId

public void deleteDocumentAtId(String id)
                        throws IOException
Throws:
IOException

writeDocument

public void writeDocument(MBaseID id,
                          OJElement elt)

isShouldPhoneticAtStart

public boolean isShouldPhoneticAtStart()

setMBaseRef

public void setMBaseRef(MBaseRef mbaseRef)

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IOException
Throws:
IOException

renewIndexReader

public void renewIndexReader()
                      throws IOException
Throws:
IOException

commitDeletions

public void commitDeletions()
                     throws IOException
Throws:
IOException