lux
Class DirectDocWriter

java.lang.Object
  extended by lux.DirectDocWriter
All Implemented Interfaces:
DocWriter

public class DirectDocWriter
extends Object
implements DocWriter

Writes documents directly to a Lucene index.


Constructor Summary
DirectDocWriter(XmlIndexer indexer, org.apache.lucene.index.IndexWriter indexWriter)
           
 
Method Summary
 void close()
          Commits and closes the underlying IndexWriter.
 void commit()
          Commits all changes to the index, making them visible to readers.
 void delete(String uri)
          Deletes the document having the given uri, if it exists.
 void deleteAll()
          Deletes all documents in the index.
 void write(net.sf.saxon.om.NodeInfo node, String uri)
          Writes a document to the index at the given uri, with the node as its root element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectDocWriter

public DirectDocWriter(XmlIndexer indexer,
                       org.apache.lucene.index.IndexWriter indexWriter)
Method Detail

write

public void write(net.sf.saxon.om.NodeInfo node,
                  String uri)
Description copied from interface: DocWriter
Writes a document to the index at the given uri, with the node as its root element. Any existing document with the same uri will be overwritten.

Specified by:
write in interface DocWriter
Parameters:
node - A node to write as a document
uri - The uri of the document

delete

public void delete(String uri)
Description copied from interface: DocWriter
Deletes the document having the given uri, if it exists.

Specified by:
delete in interface DocWriter

deleteAll

public void deleteAll()
Description copied from interface: DocWriter
Deletes all documents in the index.

Specified by:
deleteAll in interface DocWriter

commit

public void commit()
Description copied from interface: DocWriter
Commits all changes to the index, making them visible to readers. As this may be a relatively expensive operation, it is best to delay until truly necessary.

Specified by:
commit in interface DocWriter

close

public void close()
Description copied from interface: DocWriter
Commits and closes the underlying IndexWriter.

Specified by:
close in interface DocWriter


Copyright © 2013. All Rights Reserved.