|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.lucene.internal.LuceneServiceImpl
public class LuceneServiceImpl
Abstract base class for services dealing with Lucene.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.smila.lucene.LuceneIndexService |
|---|
LuceneIndexService.ExecutionMode |
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.smila.lucene.LuceneSearchService |
|---|
DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, MAPPINGS_ATTACHMENTS, MAPPINGS_ATTRIBUTES, RANKING_OPERATOR, RANKING_TOLERANCE, SEARCH_ANNOTATION_QUERY_ATTRIBUTE, SEARCH_ANNOTATION_TEMPLATE_SELECTOR_NAME |
| Fields inherited from interface org.eclipse.smila.lucene.LuceneIndexService |
|---|
PROPERTY_FORCE_UNLOCK_INDEX, PROPERTY_TEMPORARY_INDEX_DIR |
| Fields inherited from interface org.eclipse.smila.lucene.LuceneService |
|---|
BUNDLE_NAME, CONFIG_FILE_MAPPINGS, ID_FIELD |
| Constructor Summary | |
|---|---|
LuceneServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
activate(ComponentContext context)
DS activate method. |
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. |
protected void |
deactivate(ComponentContext context)
DS deactivate method. |
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. |
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> |
getMappings()
Returns the mappings. |
boolean |
isIndexExists(java.lang.String indexName)
Checks if is index exists. |
protected void |
loadMappings()
Loads the mappings. |
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. |
void |
search(Blackboard blackboard,
java.lang.String requestId,
QueryParameterAccessor parameters)
Creates a query and executes the query on the lucene index. |
protected void |
unloadMappings()
Unloads the mappings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LuceneServiceImpl()
| Method Detail |
|---|
protected void activate(ComponentContext context)
throws java.lang.Exception
context - ComponentContext
java.lang.Exception - if any error occurs
protected void deactivate(ComponentContext context)
throws java.lang.Exception
context - the ComponentContext
java.lang.Exception - if any error occurs
public void search(Blackboard blackboard,
java.lang.String requestId,
QueryParameterAccessor parameters)
throws BlackboardAccessException,
IndexException,
DataDictionaryException,
NodeTransformerException,
ProcessingException
search in interface LuceneSearchServiceblackboard - the BlackBoardServicerequestId - the record ID of the search request.parameters - query parameters
BlackboardAccessException - if any error occurs
IndexException - if any error occurs
DataDictionaryException - if any error occurs
NodeTransformerException - if any error occurs
ProcessingException - if parameter SEARCH_ANNOTATION_QUERY_ATTRIBUTE is not set for simple query or any other error occurs
public void addRecord(Blackboard blackboard,
java.lang.String id,
java.lang.String indexName,
boolean allowDoublets)
throws BlackboardAccessException,
IndexException,
java.io.IOException,
javax.xml.parsers.ParserConfigurationException
addRecord in interface LuceneIndexServiceblackboard - reference to the BlackboardServiceid - Id of the recordindexName - name of the indexallowDoublets - boolean flag if doublets of documents are allowed in the index
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
public void deleteRecord(java.lang.String id,
java.lang.String indexName)
throws IndexException
deleteRecord in interface LuceneIndexServiceid - Id of the recordindexName - name of the index
IndexException - if any error occurs
public boolean isIndexExists(java.lang.String indexName)
throws IndexException
isIndexExists in interface LuceneIndexServiceindexName - the index name
IndexException - the index exception
public void reorganizeIndex(java.lang.String indexName)
throws IndexException
reorganizeIndex in interface LuceneIndexServiceindexName - the index name
IndexException - the index exception
public void createIndex(java.lang.String indexName)
throws IndexException
createIndex in interface LuceneIndexServiceindexName - the index name
IndexException - the index exception
public void deleteIndex(java.lang.String indexName)
throws IndexException
deleteIndex in interface LuceneIndexServiceindexName - the index name
IndexException - the index exception
public void renameIndex(java.lang.String indexName,
java.lang.String newIndexName)
throws IndexException
renameIndex in interface LuceneIndexServiceindexName - the index namenewIndexName - the new index name
IndexException - the index exceptionpublic java.util.Iterator<java.lang.String> getIndexNames()
getIndexNames in interface LuceneIndexService
public void flushIndex(java.lang.String indexName)
throws IndexException
flushIndex in interface LuceneIndexServiceindexName - name of the index to flush
IndexException - if any error occurs
public void removeWriteLock(java.lang.String indexName)
throws IndexException
removeWriteLock in interface LuceneIndexServiceindexName - the name of the index to remove the lock
IndexException - if any error occursprotected void loadMappings()
protected void unloadMappings()
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> getMappings()
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||