|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.gouv.culture.sdx.utils.AbstractSdxObject
fr.gouv.culture.sdx.utils.lucene.LuceneDataStore
fr.gouv.culture.sdx.search.lucene.query.LuceneIndex
Information and services related to a LuceneIndex.
From here we can get an IndexReader, a Searcher, and know a little more about defined fields.
| Nested Class Summary |
| Nested classes inherited from class fr.gouv.culture.sdx.utils.SdxObject |
SdxObject.ConfigurationNode |
| Field Summary | |
static int |
ACTION_ADD_DOCUMENT
int representation of indexing action for adding a document. |
protected java.util.Date |
creationTimestamp
The creation date of this index |
java.lang.String |
CURRENT_INDEX_DIR
The current directory name |
static int |
DEFAULT_MAX_FIELD_LENGTH
Defaults for IndexWriter parameters; these are based on lucene defaults |
static int |
DEFAULT_MAX_MERGE_DOCS
Defaults for IndexWriter parameters; these are based on lucene defaults |
static int |
DEFAULT_MERGE_FACTOR
Defaults for IndexWriter parameters; these are based on lucene defaults |
protected java.util.Date |
lastModificationTimestamp
The last modification date of this index |
| Fields inherited from class fr.gouv.culture.sdx.utils.lucene.LuceneDataStore |
ALL_FIELD, ALL_VALUE, analyzer, fsd, fsdFile, ID_FIELD, LUCENE_CHECK_FILE, searcher, useCompoundFiles, XML_LANG_FIELD |
| Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
| Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
DEFAULT_ENCODING |
| Fields inherited from interface fr.gouv.culture.sdx.search.lucene.query.Index |
CLASS_NAME_SUFFIX |
| Fields inherited from interface fr.gouv.culture.sdx.utils.save.Saveable |
ALL_SAVE_ATTRIB, PATH_ATTRIB, SAVE_DIRECTORY_PARAM |
| Constructor Summary | |
LuceneIndex(java.io.File dir,
java.lang.String host,
java.lang.Integer port,
java.lang.String appId,
java.lang.String dbId)
Builds an index with fields definition and a path to the index files. |
|
LuceneIndex(java.io.File dir,
java.lang.String host,
java.lang.Integer port,
java.lang.String appId,
java.lang.String dbId,
boolean useCompoundFiles)
|
|
LuceneIndex(LuceneIndex parentIndex)
Sub index constructor |
|
LuceneIndex(LuceneIndex parentIndex,
java.io.File dir)
Sub index constructor |
|
| Method Summary | |
void |
backup(SaveParameters save_config)
Save LuceneIndex files |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
deleteDocument(java.lang.String docId)
Deletes a document from the index. |
int |
docCount()
|
void |
freeResources()
Free's the resources associated with this index USE WITH CARE! |
protected java.lang.String |
getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output |
java.util.Date |
getCreationDate()
|
Field |
getDefaultField()
Returns the default field for this index. |
Field |
getField(java.lang.String name)
Returns a field given a name. |
int |
getFieldType(java.lang.String name)
Returns the type of a field. |
java.lang.String |
getFieldValue(IndexableDocument doc,
java.lang.String fieldName)
|
java.util.Date |
getLastModificationDate()
|
java.util.Locale |
getLocale(java.lang.String name)
Returns the locale for a field. |
MetaAnalyzer |
getMetaAnalyzer()
Gets the MetaAnalyzer |
QueryParser |
getQueryParser()
|
org.apache.lucene.index.IndexReader |
getReader()
Returns an index reader for the current FSDirectory. |
java.lang.String |
getRemoteIndexName()
|
org.apache.lucene.search.Searchable |
getSearcher()
Gets a searcher. |
protected org.apache.lucene.index.IndexWriter |
getWriter(org.apache.lucene.store.Directory directory)
Get's an IndexWriter based upon the analyzer class field and the provided Lucene Directory |
void |
indexModified(boolean createLastModficationTimestampFile)
|
void |
init()
Initializes the Lucene database. |
boolean |
isSubIndex()
Tell if the index is a subIndex or not |
void |
mergeCurrentBatch(boolean optimize)
Merges any batch in memory and optimize it if necessary |
void |
optimize()
Index file optimization |
void |
recycleIndexReader()
|
void |
recycleLuceneIndexSearcher()
|
void |
restore(SaveParameters save_config)
Restore LuceneIndex files |
protected void |
setDocCount(int i)
|
void |
setMetaAnalyzer(MetaAnalyzer mAnalyzer)
Sets the MetaAnalyzer |
void |
setParameters(LuceneIndexParameters params)
Sets the indexing parameters |
void |
toSAX(org.xml.sax.ContentHandler hdl)
|
protected void |
writeCreationTimestampFile()
|
void |
writeDocument(org.apache.lucene.document.Document ldoc,
boolean batchIndex)
Stores a Lucene document within the database. |
void |
writeDocument(org.apache.lucene.document.Document ldoc,
boolean batchIndex,
boolean autoOptimize)
Stores a Lucene document within the database. |
void |
writeLastModificationTimestampFile(boolean create)
|
| Methods inherited from class fr.gouv.culture.sdx.utils.lucene.LuceneDataStore |
delete, delete, delete, delete, finalize, getFSDirectory, getFSDirectory, getIndexPath, getWriter, init, initToSax, initVolatileObjectsToSax, isUsingCompoundFiles, recycleSearcher, search, search, size, verifyIndex, write, writeLuceneData |
| Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, verifyConfigurationResources |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
getLog |
| Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
| Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
contextualize |
| Methods inherited from interface org.apache.avalon.framework.service.Serviceable |
service |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable |
getId, setId |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Describable |
getDescription, setDescription |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable |
getEncoding, setEncoding |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable |
getLocale, getXmlLang, setLocale, setXmlLang |
| Field Detail |
public java.lang.String CURRENT_INDEX_DIR
protected java.util.Date creationTimestamp
protected java.util.Date lastModificationTimestamp
public static final int ACTION_ADD_DOCUMENT
public static final int DEFAULT_MAX_FIELD_LENGTH
public static final int DEFAULT_MAX_MERGE_DOCS
public static final int DEFAULT_MERGE_FACTOR
| Constructor Detail |
public LuceneIndex(java.io.File dir,
java.lang.String host,
java.lang.Integer port,
java.lang.String appId,
java.lang.String dbId)
throws SDXException
dir - A directory where the index is kept.
TODOJavadoc
public LuceneIndex(java.io.File dir,
java.lang.String host,
java.lang.Integer port,
java.lang.String appId,
java.lang.String dbId,
boolean useCompoundFiles)
throws SDXException
public LuceneIndex(LuceneIndex parentIndex,
java.io.File dir)
public LuceneIndex(LuceneIndex parentIndex)
| Method Detail |
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfigure in class AbstractSdxObjectorg.apache.avalon.framework.configuration.ConfigurationException
public void init()
throws SDXException
It the index exists, nothing is done here. If it is doesn't exist, it will be created.
SDXExceptionprotected void writeCreationTimestampFile()
public void indexModified(boolean createLastModficationTimestampFile)
throws SDXException
SDXExceptionprotected void setDocCount(int i)
public int docCount()
public void writeLastModificationTimestampFile(boolean create)
public int getFieldType(java.lang.String name)
name - The name of the field for which the type is desired.
public java.util.Locale getLocale(java.lang.String name)
name - The name of the field for which the Locale is desired.public Field getDefaultField()
getDefaultField in interface Indexpublic Field getField(java.lang.String name)
getField in interface Indexname - The name of the field for which the Field is desired.public MetaAnalyzer getMetaAnalyzer()
public void setMetaAnalyzer(MetaAnalyzer mAnalyzer)
throws SDXException
mAnalyzer - A MetaAnalyzer object containing a FieldList object for this index.
SDXException
public void writeDocument(org.apache.lucene.document.Document ldoc,
boolean batchIndex)
throws SDXException
ldoc - The Lucene document to store.batchIndex - Indicates wheter a tempBatch index is taking place or not. Useful for efficiency of index optimizations
SDXException
public void writeDocument(org.apache.lucene.document.Document ldoc,
boolean batchIndex,
boolean autoOptimize)
throws SDXException
ldoc - The Lucene document to store.batchIndex - Indicates wheter a tempBatch index is taking place or not. Useful for efficiency of index optimizationsautoOptimize - Is the DocumentBase autoOptimize ?
SDXException
public void recycleLuceneIndexSearcher()
throws SDXException
SDXException
public void recycleIndexReader()
throws SDXException
SDXException
public void deleteDocument(java.lang.String docId)
throws SDXException
docId - The document's id.
SDXException
public QueryParser getQueryParser()
throws java.io.IOException,
SDXException
getQueryParser in interface Indexjava.io.IOException
SDXExceptionpublic java.lang.String getRemoteIndexName()
public void freeResources()
throws java.io.IOException
freeResources in class LuceneDataStorejava.io.IOException - Lucene IOExceptionspublic void setParameters(LuceneIndexParameters params)
params - The relevant parameters for this lucene index.
public org.apache.lucene.index.IndexReader getReader()
throws SDXException
LuceneDataStore
getReader in class LuceneDataStoreSDXException
protected org.apache.lucene.index.IndexWriter getWriter(org.apache.lucene.store.Directory directory)
throws java.io.IOException
LuceneDataStore
getWriter in class LuceneDataStoredirectory - The lucene directory for which the writer is desired
java.io.IOExceptionpublic org.apache.lucene.search.Searchable getSearcher()
getSearcher in interface IndexgetSearcher in class LuceneDataStore
public java.lang.String getFieldValue(IndexableDocument doc,
java.lang.String fieldName)
throws SDXException
SDXExceptionpublic java.util.Date getCreationDate()
public java.util.Date getLastModificationDate()
public void toSAX(org.xml.sax.ContentHandler hdl)
throws org.xml.sax.SAXException
toSAX in interface org.apache.excalibur.xml.sax.XMLizabletoSAX in class AbstractSdxObjectorg.xml.sax.SAXExceptionprotected java.lang.String getClassNameSuffix()
AbstractSdxObject
getClassNameSuffix in class AbstractSdxObject
public void optimize()
throws SDXException
optimize in class LuceneDataStoreSDXException
public void mergeCurrentBatch(boolean optimize)
throws SDXException
SDXExceptionpublic boolean isSubIndex()
public void backup(SaveParameters save_config)
throws SDXException
backup in interface Saveablebackup in class LuceneDataStoreSDXExceptionSaveable.backup(fr.gouv.culture.sdx.utils.save.SaveParameters)
public void restore(SaveParameters save_config)
throws SDXException
restore in interface Saveablerestore in class LuceneDataStoreSDXExceptionSaveable.restore(fr.gouv.culture.sdx.utils.save.SaveParameters)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||