SMILA (incubation) API documentation

org.eclipse.smila.lucene
Interface LuceneIndexService

All Superinterfaces:
LuceneService
All Known Implementing Classes:
LuceneServiceImpl

public interface LuceneIndexService
extends LuceneService

Interface for Lucene Index Service.

Author:
cind01

Nested Class Summary
static class LuceneIndexService.ExecutionMode
          Types of errors this pipelet can produce.
 
Field Summary
static java.lang.String PROPERTY_FORCE_UNLOCK_INDEX
          Configuration property if to force to unlock a locked index on service activation.
static java.lang.String PROPERTY_TEMPORARY_INDEX_DIR
          Configuration property for the index directory - if true, it will be generated and PROPERTY_INDEX_DIR will be ignored.
 
Fields inherited from interface org.eclipse.smila.lucene.LuceneService
BUNDLE_NAME, CONFIG_FILE_MAPPINGS, ID_FIELD
 
Method Summary
 void addRecord(Blackboard blackboard, java.lang.String id, java.lang.String indexName, boolean allowDoublets)
          Add a record to the Lucene index.
 void createIndex(java.lang.String indexName)
          Creates the index.
 void deleteIndex(java.lang.String indexName)
          Delete index.
 void deleteRecord(java.lang.String id, java.lang.String indexName)
          Delete a record from the Lucene index.
 void flushIndex(java.lang.String indexName)
          Flushes the index with the given name.
 java.util.Iterator<java.lang.String> getIndexNames()
          Returns the names of all available indexes.
 boolean isIndexExists(java.lang.String indexName)
          Checks if is index exists.
 void removeWriteLock(java.lang.String indexName)
          Removes the write.lock of the Lucene index if any exists.
 void renameIndex(java.lang.String indexName, java.lang.String newIndexName)
          Rename index.
 void reorganizeIndex(java.lang.String indexName)
          Reorganize index.
 

Field Detail

PROPERTY_TEMPORARY_INDEX_DIR

static final java.lang.String PROPERTY_TEMPORARY_INDEX_DIR
Configuration property for the index directory - if true, it will be generated and PROPERTY_INDEX_DIR will be ignored.

See Also:
Constant Field Values

PROPERTY_FORCE_UNLOCK_INDEX

static final java.lang.String PROPERTY_FORCE_UNLOCK_INDEX
Configuration property if to force to unlock a locked index on service activation. Unlocking may corrupt an existing index. This option is useful for tests. If not set the default is false.

See Also:
Constant Field Values
Method Detail

addRecord

void addRecord(Blackboard blackboard,
               java.lang.String id,
               java.lang.String indexName,
               boolean allowDoublets)
               throws BlackboardAccessException,
                      IndexException,
                      java.io.IOException,
                      javax.xml.parsers.ParserConfigurationException
Add a record to the Lucene index.

Parameters:
blackboard - reference to the BlackboardService
id - Id of the record
indexName - name of the index
allowDoublets - boolean flag if doublets of documents are allowed in the index
Throws:
BlackboardAccessException - if any error occurs
IndexException - if any error occurs
java.io.IOException - if any error occurs
javax.xml.parsers.ParserConfigurationException - if any error occurs

deleteRecord

void deleteRecord(java.lang.String id,
                  java.lang.String indexName)
                  throws IndexException
Delete a record from the Lucene index.

Parameters:
id - Id of the record
indexName - name of the index
Throws:
IndexException - if any error occurs

createIndex

void createIndex(java.lang.String indexName)
                 throws IndexException
Creates the index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

deleteIndex

void deleteIndex(java.lang.String indexName)
                 throws IndexException
Delete index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

flushIndex

void flushIndex(java.lang.String indexName)
                throws IndexException
Flushes the index with the given name.

Parameters:
indexName - name of the index to flush
Throws:
IndexException - if any error occurs

getIndexNames

java.util.Iterator<java.lang.String> getIndexNames()
Returns the names of all available indexes.

Returns:
an iterator over index names

isIndexExists

boolean isIndexExists(java.lang.String indexName)
                      throws IndexException
Checks if is index exists.

Parameters:
indexName - the index name
Returns:
true, if is index exists
Throws:
IndexException - the index exception

removeWriteLock

void removeWriteLock(java.lang.String indexName)
                     throws IndexException
Removes the write.lock of the Lucene index if any exists.

Parameters:
indexName - the name of the index to remove the lock
Throws:
IndexException - if any error occurs

renameIndex

void renameIndex(java.lang.String indexName,
                 java.lang.String newIndexName)
                 throws IndexException
Rename index.

Parameters:
indexName - the index name
newIndexName - the new index name
Throws:
IndexException - the index exception

reorganizeIndex

void reorganizeIndex(java.lang.String indexName)
                     throws IndexException
Reorganize index.

Parameters:
indexName - the index name
Throws:
IndexException - the index exception

SMILA (incubation) API documentation