|
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.search.index.IndexConnection
org.eclipse.smila.search.lucene.index.IndexConnection
public class IndexConnection
The Class IndexConnection.
| Field Summary | |
|---|---|
static java.lang.String |
DATE_FORMAT_PATTERN
Date format pattern. |
| Constructor Summary | |
|---|---|
IndexConnection(java.lang.String indexName)
The Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addHighlightAnnotation(IQueryExpression dQE,
java.lang.String recordId,
AnyMap highlight,
int fieldNo,
java.lang.String attributeName,
java.lang.String indexName)
Adds a highlighting annotation on the given record and attribute |
protected void |
close()
Close index connection. |
protected Value |
createValue(DataFactory f,
int fieldNo,
java.lang.String value)
create value from string using the appropriate type method. |
void |
deleteDocument(java.lang.String id)
Delete document from index. |
boolean |
docExists(java.lang.String id)
Checks whether a document exists in index. |
LuceneSearchResult |
doQuery(IQueryExpression queryExpression,
int startPos)
Execute search query. |
LuceneSearchResult |
doQueryCallback(IndexSearcher indexSearcher,
DQueryExpression queryExpression,
int startPos)
Do query callback for DoQueryOperation. |
protected void |
encodeTextField(DTextField tf)
|
Analyzer |
getAnalyzer()
Get Analyzer. |
protected void |
getResultValues(java.lang.String[] keys,
int[] fields,
java.lang.String[][] values)
|
protected java.lang.String[] |
getResultValues(java.lang.String id,
int fieldNo)
|
IQueryExpression |
getSimpleSearchQuery(DQuery dQuery)
Transform a simple search to the corresponding advanced search. |
protected IQueryExpression |
getTestQueryExpression(java.lang.String text)
|
protected void |
insertDateParameter(DDateField field,
IDFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
|
protected void |
insertNumberParameter(DNumberField field,
INFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
|
protected void |
insertTextParameter(DTextField field,
ITFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
|
protected void |
isSupportedValue(int fieldNo,
java.lang.Object value)
|
void |
learnDocument(Blackboard blackboard,
java.lang.String id,
java.util.Map<java.lang.String,java.lang.Integer> attributeMapping,
java.util.Map<java.lang.String,java.lang.Integer> attachmentMapping)
Add a document to index. |
java.lang.String |
padNumField(java.lang.String text)
Enclose number in a fixed length text to allow range search. |
protected void |
startBurstmode()
Start burst mode. |
protected void |
stopBurstmode()
Stop burst mode. |
void |
unlock()
Unlocks a locked index. |
| Methods inherited from class org.eclipse.smila.search.index.IndexConnection |
|---|
doQuery, doQuery, doTestQuery, getIndex, getName, validateQuery |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DATE_FORMAT_PATTERN
| Constructor Detail |
|---|
public IndexConnection(java.lang.String indexName)
throws IndexException
indexName - Index name.
IndexException - Unable to create index connection.| Method Detail |
|---|
protected void close()
close in class IndexConnectionIndexConnection.close()
public boolean docExists(java.lang.String id)
throws IndexException
docExists in class IndexConnectionid - the Id
IndexException - Unable to check the document exists in index.
public void deleteDocument(java.lang.String id)
throws IndexException
deleteDocument in class IndexConnectionid - the Id
IndexException - Unable to delete document from index.
public void learnDocument(Blackboard blackboard,
java.lang.String id,
java.util.Map<java.lang.String,java.lang.Integer> attributeMapping,
java.util.Map<java.lang.String,java.lang.Integer> attachmentMapping)
throws IndexException,
BlackboardAccessException
learnDocument in class IndexConnectionblackboard - the BlackboardServiceid - the Id of the record to add.attributeMapping - Map containing the attribute to FieldNo mappingattachmentMapping - Map containing the attachment to FieldNo mapping
IndexException - Unable to add document to index.
BlackboardAccessException - if errors occur accessing the Blackboardpublic java.lang.String padNumField(java.lang.String text)
text - Number to pad.
public Analyzer getAnalyzer()
protected void startBurstmode()
throws IndexException
startBurstmode in class IndexConnectionIndexException - Unable to start burst mode.IndexConnection.startBurstmode()
protected void stopBurstmode()
throws IndexException
stopBurstmode in class IndexConnectionIndexException - Unable to stop burst mode.IndexConnection.stopBurstmode()
public IQueryExpression getSimpleSearchQuery(DQuery dQuery)
throws IndexException,
NodeTransformerException,
TemplateException
getSimpleSearchQuery in class IndexConnectiondQuery - Simple search.
IndexException - Unable to get advanced search.
NodeTransformerException - Unable to perform node transformation.
TemplateException - Unable to apply template.#getSimpleSearchQuery(org.eclipse.smila.search.utils.search.DQuery)
public LuceneSearchResult doQuery(IQueryExpression queryExpression,
int startPos)
throws IndexException
doQuery in class IndexConnectionqueryExpression - Advanced search query.startPos - Start position.
IndexException - Unable to perform search query.IndexConnection.doQuery(org.eclipse.smila.search.utils.advsearch.IQueryExpression,
int)
public LuceneSearchResult doQueryCallback(IndexSearcher indexSearcher,
DQueryExpression queryExpression,
int startPos)
throws XMLUtilsException,
AdvSearchException,
IndexException,
java.io.IOException
indexSearcher - the index searcherqueryExpression - the query expressionstartPos - the start pos
XMLUtilsException - the XML utils exception
AdvSearchException - the adv search exception
IndexException - the index exception
java.io.IOException - Signals that an I/O exception has occurred.
protected IQueryExpression getTestQueryExpression(java.lang.String text)
throws IndexException
getTestQueryExpression in class IndexConnectiontext - -
IndexException - -IndexConnection.getTestQueryExpression(java.lang.String)
protected void insertTextParameter(DTextField field,
ITFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
insertTextParameter in class IndexConnectionfield - -configParameter - -config - -sb - -IndexConnection.insertTextParameter(org.eclipse.smila.search.utils.search.DTextField,
org.eclipse.smila.search.utils.search.ITFParameter, java.lang.String, java.lang.StringBuffer)
protected void insertNumberParameter(DNumberField field,
INFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
insertNumberParameter in class IndexConnectionfield - -configParameter - -config - -sb - -#insertNumberParameter(org.eclipse.smila.search.utils.search.DNumberField,
org.eclipse.smila.search.utils.search.INFParameter, java.lang.String, java.lang.StringBuffer)
protected void insertDateParameter(DDateField field,
IDFParameter configParameter,
java.lang.String config,
java.lang.StringBuffer sb)
insertDateParameter in class IndexConnectionfield - -configParameter - -config - -sb - -#insertDateParameter(org.eclipse.smila.search.utils.search.DDateField,
org.eclipse.smila.search.utils.search.IDFParameter, java.lang.String, java.lang.StringBuffer)
protected void getResultValues(java.lang.String[] keys,
int[] fields,
java.lang.String[][] values)
throws IndexException
getResultValues in class IndexConnectionkeys - -fields - -values - -
IndexException - -#getResultValues(java.lang.String[], int[],
java.lang.String[][])
protected java.lang.String[] getResultValues(java.lang.String id,
int fieldNo)
throws IndexException
getResultValues in class IndexConnectionIndexException
protected void encodeTextField(DTextField tf)
throws IndexException
encodeTextField in class IndexConnectiontf - -
IndexException - -IndexConnection.encodeTextField(org.eclipse.smila.search.utils.search.DTextField)
protected void isSupportedValue(int fieldNo,
java.lang.Object value)
throws IndexException
isSupportedValue in class IndexConnectionfieldNo - -value - -
IndexException - -IndexConnection.isSupportedValue(int, java.lang.Object)
protected Value createValue(DataFactory f,
int fieldNo,
java.lang.String value)
throws IndexException
createValue in class IndexConnectionfieldNo - the fieldNovalue - the string value
IndexException - if any error occurs
protected void addHighlightAnnotation(IQueryExpression dQE,
java.lang.String recordId,
AnyMap highlight,
int fieldNo,
java.lang.String attributeName,
java.lang.String indexName)
throws IndexException
addHighlightAnnotation in class IndexConnectiondQE - the IQueryExpressionrecordId - record idhighlight - the highlight annotation.fieldNo - the fieldNoattributeName - the name of the attributeindexName - the name of the index
IndexException - if any errorr occurs
public void unlock()
throws IndexException
IndexConnection
unlock in class IndexConnectionIndexException - if any error occursunlock()
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||