Package org.opencms.search
Interface I_CmsIndexWriter
- All Known Subinterfaces:
I_CmsSolrIndexWriter
- All Known Implementing Classes:
CmsLuceneIndexWriter
,CmsSolrIndexWriter
public interface I_CmsIndexWriter
Abstracts the index writer implementation for the most important index manipulation operations.
- Since:
- 8.0.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
(String rootPath, I_CmsSearchDocument document) Update a document in the index.
-
Method Details
-
close
Close this IndexWriter.- Throws:
IOException
- thrown if the close action fails.
-
commit
Commit all previous operations.- Throws:
IOException
- thrown if the commit action fails.
-
deleteDocument
Delete a document from the index.- Parameters:
resource
- the resource to delete- Throws:
IOException
- in case something goes wrong
-
optimize
Optimizes 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.
- Throws:
IOException
- thrown if the optimization fails.
-
updateDocument
Update a document in the index.- Parameters:
rootPath
- the root path of the document to updatedocument
- the document to update- Throws:
IOException
- in case something goes wrong
-