com.elasticpath.persistence.impl
Class IndexWriterImpl

java.lang.Object
  extended by com.elasticpath.persistence.impl.IndexWriterImpl
All Implemented Interfaces:
IndexWriter

public class IndexWriterImpl
extends java.lang.Object
implements IndexWriter

A default implementation of IndexWriter.


Constructor Summary
IndexWriterImpl()
           
 
Method Summary
 void addDocument(org.apache.lucene.document.Document document)
          Adds the given document to index.
 void close()
          Close the index writer.
 void deleteDocument(long uid)
          Deletes the document specified by the uid.
 void deleteDocument(java.lang.String uid)
          Deletes the document specified by the uid.
 void flush()
          Flush the changes.
 void open(java.util.Locale locale, boolean recreate)
          Open the index writer with the given locale.
 void open(java.lang.String indexDir, java.util.Locale locale, boolean recreate)
          Open the index writer with the given locale at the given directory.
 void setElasticPath(ElasticPath elasticPath)
          Set the ElasticPath instance.
 void setIndexDirectory(java.lang.String indexDirectory)
          Set the name of index directory.
 void updateDocument(org.apache.lucene.document.Document document)
          Updates the document in the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexWriterImpl

public IndexWriterImpl()
Method Detail

addDocument

public void addDocument(org.apache.lucene.document.Document document)
Adds the given document to index.

Specified by:
addDocument in interface IndexWriter
Parameters:
document - the document to add into index

close

public void close()
Close the index writer.

Specified by:
close in interface IndexWriter

deleteDocument

public void deleteDocument(long uid)
Deletes the document specified by the uid.

Specified by:
deleteDocument in interface IndexWriter
Parameters:
uid - the uid of the object

deleteDocument

public void deleteDocument(java.lang.String uid)
Deletes the document specified by the uid.

Specified by:
deleteDocument in interface IndexWriter
Parameters:
uid - the uid of the object

flush

public void flush()
Flush the changes.

Specified by:
flush in interface IndexWriter

open

public void open(java.util.Locale locale,
                 boolean recreate)
Open the index writer with the given locale.

Specified by:
open in interface IndexWriter
Parameters:
locale - the locale
recreate - set this to true if you want to recreate the index.

open

public void open(java.lang.String indexDir,
                 java.util.Locale locale,
                 boolean recreate)
Open the index writer with the given locale at the given directory.

Specified by:
open in interface IndexWriter
Parameters:
indexDir - the index directory
locale - the locale
recreate - set this to true if you want to recreate the index.

setElasticPath

public void setElasticPath(ElasticPath elasticPath)
Set the ElasticPath instance.

Parameters:
elasticPath - the instance of ElasticPath

setIndexDirectory

public void setIndexDirectory(java.lang.String indexDirectory)
Set the name of index directory.

Parameters:
indexDirectory - the directory containing the index file

updateDocument

public void updateDocument(org.apache.lucene.document.Document document)
Updates the document in the index.

Specified by:
updateDocument in interface IndexWriter
Parameters:
document - the document to update in the index