|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.search.solr.CmsSolrIndexWriter
public class CmsSolrIndexWriter
Implements the index writer for the Solr server used by OpenCms.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
The log object for this class. |
| Constructor Summary | |
|---|---|
CmsSolrIndexWriter(org.apache.solr.client.solrj.SolrServer server)
Constructor to create a Solr index writer. |
|
CmsSolrIndexWriter(org.apache.solr.client.solrj.SolrServer server,
CmsSolrIndex index)
Creates a new index writer based on the provided standard Lucene IndexWriter for the provided OpenCms search index instance. |
|
| Method Summary | |
|---|---|
void |
close()
Close this IndexWriter. |
void |
commit()
Commit all previous operations. |
void |
deleteAllDocuments()
Deletes all documents of the index belonging to this index writer. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public CmsSolrIndexWriter(org.apache.solr.client.solrj.SolrServer server)
server - the server to use
public CmsSolrIndexWriter(org.apache.solr.client.solrj.SolrServer server,
CmsSolrIndex index)
The OpenCms search instance is currently used only for improved logging of the index operations.
server - the standard Lucene IndexWriter to use as delegateindex - the OpenCms search index instance this writer to supposed to write to| Method Detail |
|---|
public void close()
I_CmsIndexWriter
close in interface I_CmsIndexWriterI_CmsIndexWriter.close()
public void commit()
throws java.io.IOException
I_CmsIndexWriter
commit in interface I_CmsIndexWriterjava.io.IOExceptionI_CmsIndexWriter.commit()
public void deleteAllDocuments()
throws java.io.IOException
java.io.IOException - if something goes wrong
public void deleteDocuments(java.lang.String rootPath)
throws java.io.IOException
I_CmsIndexWriter
deleteDocuments in interface I_CmsIndexWriterrootPath - the root path of the document to delete
java.io.IOException - in case something goes wrongI_CmsIndexWriter.deleteDocuments(java.lang.String)public void optimize()
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 in interface I_CmsIndexWriterI_CmsIndexWriter.optimize()
public void updateDocument(java.lang.String rootPath,
I_CmsSearchDocument document)
throws java.io.IOException
I_CmsIndexWriter
updateDocument in interface I_CmsIndexWriterrootPath - the root path of the document to updatedocument - the document to update
java.io.IOException - in case something goes wrongI_CmsIndexWriter.updateDocument(java.lang.String, org.opencms.search.I_CmsSearchDocument)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||