public class CmsLuceneIndexWriter extends java.lang.Object implements I_CmsIndexWriter
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
The log object for this class.
|
| 构造器和说明 |
|---|
CmsLuceneIndexWriter(org.apache.lucene.index.IndexWriter indexWriter)
Creates a new index writer based on the provided standard Lucene IndexWriter.
|
CmsLuceneIndexWriter(org.apache.lucene.index.IndexWriter indexWriter,
CmsSearchIndex index)
Creates a new index writer based on the provided standard Lucene IndexWriter for the
provided OpenCms search index instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close this IndexWriter.
|
void |
commit()
Commit all previous operations.
|
void |
deleteDocument(CmsPublishedResource resource)
Delete a document from the index.
|
void |
optimize()
Optimizes the index.
|
void |
updateDocument(java.lang.String rootPath,
I_CmsSearchDocument document)
Update a document in the index.
|
public CmsLuceneIndexWriter(org.apache.lucene.index.IndexWriter indexWriter)
indexWriter - the standard Lucene IndexWriter to use as delegatepublic CmsLuceneIndexWriter(org.apache.lucene.index.IndexWriter indexWriter,
CmsSearchIndex index)
The OpenCms search instance is currently used only for improved logging of the index operations.
indexWriter - the standard Lucene IndexWriter to use as delegateindex - the OpenCms search index instance this writer to supposed to write topublic void close()
throws java.io.IOException
I_CmsIndexWriterclose 在接口中 I_CmsIndexWriterjava.io.IOExceptionI_CmsIndexWriter.close()public void commit()
throws java.io.IOException
I_CmsIndexWritercommit 在接口中 I_CmsIndexWriterjava.io.IOExceptionI_CmsIndexWriter.commit()public void deleteDocument(CmsPublishedResource resource) throws java.io.IOException
I_CmsIndexWriterdeleteDocument 在接口中 I_CmsIndexWriterresource - the resource to deletejava.io.IOException - in case something goes wrongI_CmsIndexWriter.deleteDocument(org.opencms.db.CmsPublishedResource)public void optimize()
throws java.io.IOException
I_CmsIndexWriterPlease note that as of Lucene 3.5, the direct use of optimize is discouraged as Lucene apparently is now able to manage the file structure so efficiently that frequent optimizations are not longer required.
optimize 在接口中 I_CmsIndexWriterjava.io.IOExceptionAs optimize is deprecated with Lucene 3.5, this implementation
actually calls {@link IndexWriter#forceMerge(int)}.public void updateDocument(java.lang.String rootPath,
I_CmsSearchDocument document)
throws java.io.IOException
I_CmsIndexWriterupdateDocument 在接口中 I_CmsIndexWriterrootPath - the root path of the document to updatedocument - the document to updatejava.io.IOException - in case something goes wrongI_CmsIndexWriter.updateDocument(java.lang.String, org.opencms.search.I_CmsSearchDocument)