org.opencms.search
Interface I_CmsIndexWriter

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
 void close()
          Close this IndexWriter.
 void commit()
          Commit all previous operations.
 void deleteDocuments(java.lang.String rootPath)
          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

commit

void commit()
            throws java.io.IOException
Commit all previous operations.

Throws:
java.io.IOException

deleteDocuments

void deleteDocuments(java.lang.String rootPath)
                     throws java.io.IOException
Delete a document from the index.

Parameters:
rootPath - the root path of the document 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

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 update
document - the document to update
Throws:
java.io.IOException - in case something goes wrong