|
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,
Record record,
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. |
void |
deleteDocument(Id id)
Delete document from index. |
void |
deleteDocument(java.lang.String key)
Delete document from index. |
boolean |
docExists(Id id)
Checks whether a document exists in index. |
boolean |
docExists(java.lang.String key)
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 java.lang.String[] |
getResultValues(Id id,
int fieldNo)
|
protected void |
getResultValues(java.lang.String[] keys,
int[] fields,
java.lang.String[][] values)
|
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,
Id 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 |
setLiteralValue(Literal literal,
int fieldNo,
java.lang.String value)
Set the value of the given literal using the appropriate type method. |
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 IndexConnection
IndexConnection.close()
public boolean docExists(java.lang.String key) throws IndexException
docExists
in class IndexConnection
key
- Key.
IndexException
- Unable to check the document exists in index.IndexConnection.docExists(java.lang.String)
public boolean docExists(Id id) throws IndexException
docExists
in class IndexConnection
id
- the Id
IndexException
- Unable to check the document exists in index.IndexConnection.docExists(org.eclipse.smila.datamodel.id.Id)
public void deleteDocument(java.lang.String key) throws IndexException
deleteDocument
in class IndexConnection
key
- Key.
IndexException
- Unable to delete document from index.IndexConnection.deleteDocument(java.lang.String)
public void deleteDocument(Id id) throws IndexException
deleteDocument
in class IndexConnection
id
- the Id
IndexException
- Unable to delete document from index.IndexConnection.deleteDocument(org.eclipse.smila.datamodel.id.Id)
public void learnDocument(Blackboard blackboard, Id 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 IndexConnection
blackboard
- 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 BlackboardIndexConnection.learnDocument(org.eclipse.smila.blackboard.Blackboard,
org.eclipse.smila.datamodel.id.Id, java.util.Map, java.util.Map)
public java.lang.String padNumField(java.lang.String text)
text
- Number to pad.
public Analyzer getAnalyzer()
protected void startBurstmode() throws IndexException
startBurstmode
in class IndexConnection
IndexException
- Unable to start burst mode.IndexConnection.startBurstmode()
protected void stopBurstmode() throws IndexException
stopBurstmode
in class IndexConnection
IndexException
- Unable to stop burst mode.IndexConnection.stopBurstmode()
public IQueryExpression getSimpleSearchQuery(DQuery dQuery) throws IndexException, NodeTransformerException, TemplateException
getSimpleSearchQuery
in class IndexConnection
dQuery
- 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 IndexConnection
queryExpression
- 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 IndexConnection
text
- -
IndexException
- -IndexConnection.getTestQueryExpression(java.lang.String)
protected void insertTextParameter(DTextField field, ITFParameter configParameter, java.lang.String config, java.lang.StringBuffer sb)
insertTextParameter
in class IndexConnection
field
- -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 IndexConnection
field
- -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 IndexConnection
field
- -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 IndexConnection
keys
- -fields
- -values
- -
IndexException
- -#getResultValues(java.lang.String[], int[],
java.lang.String[][])
protected java.lang.String[] getResultValues(Id id, int fieldNo) throws IndexException
getResultValues
in class IndexConnection
IndexException
protected void encodeTextField(DTextField tf) throws IndexException
encodeTextField
in class IndexConnection
tf
- -
IndexException
- -IndexConnection.encodeTextField(org.eclipse.smila.search.utils.search.DTextField)
protected void isSupportedValue(int fieldNo, java.lang.Object value) throws IndexException
isSupportedValue
in class IndexConnection
fieldNo
- -value
- -
IndexException
- -IndexConnection.isSupportedValue(int, java.lang.Object)
protected void setLiteralValue(Literal literal, int fieldNo, java.lang.String value) throws IndexException
setLiteralValue
in class IndexConnection
literal
- the literal to set the valuefieldNo
- the fieldNovalue
- the string value
IndexException
- if any error occursIndexConnection.setLiteralValue(Literal, int, String)
protected void addHighlightAnnotation(IQueryExpression dQE, Record record, int fieldNo, java.lang.String attributeName, java.lang.String indexName) throws IndexException
addHighlightAnnotation
in class IndexConnection
dQE
- the IQueryExpressionrecord
- the RecordfieldNo
- the fieldNoattributeName
- the name of the attributeindexName
- the name of the index
IndexException
- if any errorr occursorg.eclipse.smila.search.index.IndexConnection#addHighlightAnnotation(IQueryExpression, Record,
fieldNo,String, String)
public void unlock() throws IndexException
IndexConnection
unlock
in class IndexConnection
IndexException
- if any error occursunlock()
|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |