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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
close
void close() throws java.io.IOException
Close this IndexWriter.- Throws:
java.io.IOException
- thrown if the close action fails.
-
commit
void commit() throws java.io.IOException
Commit all previous operations.- Throws:
java.io.IOException
- thrown if the commit action fails.
-
deleteDocument
void deleteDocument(CmsPublishedResource resource) throws java.io.IOException
Delete a document from the index.- Parameters:
resource
- the resource to delete- Throws:
java.io.IOException
- in case something goes wrong
-
optimize
void optimize() throws java.io.IOException
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:
java.io.IOException
- thrown if the optimization fails.
-
updateDocument
void updateDocument(java.lang.String rootPath, I_CmsSearchDocument document) throws java.io.IOException
Update a document in the index.- Parameters:
rootPath
- the root path of the document to updatedocument
- the document to update- Throws:
java.io.IOException
- in case something goes wrong
-
-