|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Writer
Conquiris index writer interface. Commit properties starting with the 'cq:' prefix are reserved.
If no state modifiers methods are called nothing will be commited to the index. Implementations
MUST BE thread-safe. All methods throw IllegalStateException if the writer can no longer
be used, InterruptedException if the thread they are running is interrupted and
IndexException if there's a problem with the index.
| Method Summary | |
|---|---|
Writer |
add(Document document)
Adds a document. |
Writer |
add(Document document,
Analyzer analyzer)
Adds a document. |
void |
cancel()
Cancels the operation of this writer. |
Writer |
delete(String field,
String text)
Deletes documents matching a certain term. |
Writer |
delete(Term term)
Deletes documents matching a certain term. |
Writer |
deleteAll()
Deletes all documents. |
String |
getCheckpoint()
Returns the commit checkpoint, or null if there was no checkpoint. |
IndexInfo |
getIndexInfo()
Returns the last commit index info. |
String |
getProperty(String key)
Returns a commit property. |
Set<String> |
getPropertyKeys()
Returns the existing property keys. |
String |
getTargetCheckpoint()
Returns the last known target checkpoint, or null if there was no checkpoint. |
Writer |
runSubindexers(Executor executor,
Iterable<? extends Subindexer> subindexers)
Runs a collection of subindexers using the provided executor, waiting for them to finish. |
Writer |
setCheckpoint(String checkpoint)
Sets the new checkpoint. |
Writer |
setProperties(Map<String,String> values)
Sets a collection of commit property value. |
Writer |
setProperty(String key,
String value)
Sets a commit property value. |
Writer |
setTargetCheckpoint(String targetCheckpoint)
Sets the new target checkpoint. |
Writer |
update(String field,
String text,
Document document)
Atomically (with respect to index flushing) deletes the documents matching a certain term and adds a document. |
Writer |
update(String field,
String text,
Document document,
Analyzer analyzer)
Atomically (with respect to index flushing) deletes the documents matching a certain term and adds a document. |
Writer |
update(Term term,
Document document)
Atomically (with respect to index flushing) deletes the documents matching a certain term and adds a document. |
Writer |
update(Term term,
Document document,
Analyzer analyzer)
Atomically (with respect to index flushing) deletes the documents matching a certain term and adds a document. |
| Method Detail |
|---|
void cancel()
throws InterruptedException
InterruptedException
IndexInfo getIndexInfo()
throws InterruptedException
InterruptedException
String getCheckpoint()
throws InterruptedException
null if there was no checkpoint. Includes the
modifications performed in this writer.
InterruptedException
String getTargetCheckpoint()
throws InterruptedException
null if there was no checkpoint. Includes
the modifications performed in this writer.
InterruptedException
String getProperty(String key)
throws InterruptedException
key - Property key.
null if the property does no exist.
IllegalArgumentException - if a reserved property is requested.
InterruptedException
Set<String> getPropertyKeys()
throws InterruptedException
InterruptedException
Writer setCheckpoint(@Nullable
String checkpoint)
throws InterruptedException
checkpoint - New checkpoint.
InterruptedException
Writer setTargetCheckpoint(@Nullable
String targetCheckpoint)
throws InterruptedException
targetCheckpoint - New target checkpoint.
InterruptedException
Writer setProperty(String key,
String value)
throws InterruptedException
key - Property key.value - Value to set. If null the property is removed.
IllegalArgumentException - if a provided key is reserverd.
InterruptedException
Writer setProperties(Map<String,String> values)
throws InterruptedException
values - Values to set. For those properties which value is null the property will
be removed.
IllegalArgumentException - if any of the provided key is reserved.
InterruptedException
Writer add(@Nullable
Document document)
throws InterruptedException,
IndexException
add in interface DocumentWriterdocument - Document to add. If null the method is a no-op.
InterruptedException
IndexException
Writer add(@Nullable
Document document,
@Nullable
Analyzer analyzer)
throws InterruptedException,
IndexException
add in interface DocumentWriterdocument - Document to add. If null the method is a no-op.analyzer - Analyzer to use. If null the service default analyzer will be used.
InterruptedException
IndexException
Writer deleteAll()
throws InterruptedException,
IndexException
deleteAll in interface DocumentWriterInterruptedException
IndexException
Writer delete(@Nullable
String field,
@Nullable
String text)
throws InterruptedException,
IndexException
delete in interface DocumentWriterfield - Field to match. If null the method is a no-op.text - Term text to match. If null the method is a no-op.
InterruptedException
IndexException
Writer delete(@Nullable
Term term)
throws InterruptedException,
IndexException
delete in interface DocumentWriterterm - Term to match. If null the method is a no-op.
InterruptedException
IndexException
Writer update(@Nullable
String field,
@Nullable
String text,
@Nullable
Document document)
throws InterruptedException,
IndexException
update in interface DocumentWriterfield - Field to match. If null no deletion will be performed.text - Term text to match. If null no deletion will be performed.document - Document to add. If null no document will be added.
InterruptedException
IndexException
Writer update(@Nullable
Term term,
@Nullable
Document document)
throws InterruptedException,
IndexException
update in interface DocumentWriterterm - Term to match. If null no deletion will be performed.document - Document to add. If null no document will be added.
InterruptedException
IndexException
Writer update(@Nullable
String field,
@Nullable
String text,
@Nullable
Document document,
@Nullable
Analyzer analyzer)
throws InterruptedException,
IndexException
update in interface DocumentWriterfield - Field to match. If null no deletion will be performed.text - Term text to match. If null no deletion will be performed.document - Document to add. If null no document will be added.analyzer - Analyzer to use. If null the service default analyzer will be used.
InterruptedException
IndexException
Writer update(@Nullable
Term term,
@Nullable
Document document,
@Nullable
Analyzer analyzer)
throws InterruptedException,
IndexException
update in interface DocumentWriterterm - Term to match. If null no deletion will be performed.document - Document to add. If null no document will be added.analyzer - Analyzer to use. If null the service default analyzer will be used.
InterruptedException
IndexException
Writer runSubindexers(Executor executor,
Iterable<? extends Subindexer> subindexers)
throws InterruptedException,
IndexException
executor - Executor to use.subindexers - Indexers to run.
InterruptedException
IndexException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||