Package org.opencms.search
Class CmsLuceneIndexWriter
java.lang.Object
org.opencms.search.CmsLuceneIndexWriter
- All Implemented Interfaces:
I_CmsIndexWriter
Delegates indexing to a standard Lucene IndexWriter.
- Since:
- 8.0.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.LogThe log object for this class. -
Constructor Summary
ConstructorsConstructorDescriptionCmsLuceneIndexWriter(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this IndexWriter.voidcommit()Commit all previous operations.voiddeleteDocument(CmsPublishedResource resource) Delete a document from the index.voidoptimize()Optimizes the index.voidupdateDocument(String rootPath, I_CmsSearchDocument document) Update a document in the index.
-
Field Details
-
LOG
The log object for this class.
-
-
Constructor Details
-
CmsLuceneIndexWriter
Creates a new index writer based on the provided standard Lucene IndexWriter.- Parameters:
indexWriter- the standard Lucene IndexWriter to use as delegate
-
CmsLuceneIndexWriter
Creates a new index writer based on the provided standard Lucene IndexWriter for the provided OpenCms search index instance.The OpenCms search instance is currently used only for improved logging of the index operations.
- Parameters:
indexWriter- the standard Lucene IndexWriter to use as delegateindex- the OpenCms search index instance this writer to supposed to write to
-
-
Method Details
-
close
Description copied from interface:I_CmsIndexWriterClose this IndexWriter.- Specified by:
closein interfaceI_CmsIndexWriter- Throws:
IOException- thrown if the close action fails.- See Also:
-
commit
Description copied from interface:I_CmsIndexWriterCommit all previous operations.- Specified by:
commitin interfaceI_CmsIndexWriter- Throws:
IOException- thrown if the commit action fails.- See Also:
-
deleteDocument
Description copied from interface:I_CmsIndexWriterDelete a document from the index.- Specified by:
deleteDocumentin interfaceI_CmsIndexWriter- Parameters:
resource- the resource to delete- Throws:
IOException- in case something goes wrong- See Also:
-
optimize
Description copied from interface:I_CmsIndexWriterOptimizes the index.Please 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.
- Specified by:
optimizein interfaceI_CmsIndexWriter- Throws:
IOException- thrown if the optimization fails.- See Also:
-
updateDocument
Description copied from interface:I_CmsIndexWriterUpdate a document in the index.- Specified by:
updateDocumentin interfaceI_CmsIndexWriter- Parameters:
rootPath- the root path of the document to updatedocument- the document to update- Throws:
IOException- in case something goes wrong- See Also:
-