|
Qizx/open 4.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FullTextPullStream
An extension of XMLPullStream that separates fragments of text matching the key terms of a full-text query. This is typically used for "highlighting" full-text terms, by wrapping full-text terms with some decoration, for example a B or SPAN element in HTML.
Note that this interface does not define how the full-text query is specified.
A Text node that contains one or several terms of a full-text query generates several events of type TEXT and FT_TERM, instead of simply one.
Example: the full-text query is: . ftcontains 'romeo juliet',
and the BasicFullTextPullStream is used on this document:
<PLAY> <TITLE>The Tragedy of Romeo and Juliet</TITLE> <FM> ...
Events generated are successively:
| DOCUMENT_START | ||
| ELEMENT_START | name=PLAY | |
| ELEMENT_START | name=TITLE | |
| TEXT | text='The Tragedy of ' | wordCount=3 |
| FT_TERM | text='Romeo' | wordCount=1 , termPosition=0 |
| TEXT | text=' and ' | wordCount=1 |
| FT_TERM | text='Juliet' | wordCount=1 , termPosition=1 |
| ELEMENT_END | name=TITLE | |
| ... | ... |
Additional information is returned on each fragment TEXT or FT_TERM:
Query-position of the term, an integer value that represents the rank of the term in the query [noted termPosition above].
| Field Summary | |
|---|---|
static int |
FT_TERM
Event code returned when a query word or phrase is recognized. |
| Fields inherited from interface com.qizx.api.XMLPullStream |
|---|
COMMENT, DOCUMENT_END, DOCUMENT_START, ELEMENT_END, ELEMENT_START, END, PROCESSING_INSTRUCTION, START, TEXT |
| Method Summary | |
|---|---|
int |
getQueryTermCount()
Returns the number of terms in the query. |
String[] |
getQueryTerms()
Returns the terms of the query as a String array. |
int |
getTermPosition()
On a FT_TERM event, returns the rank of the term (word, wildcard) in the full-text query. |
int |
getWordCount()
On a TEXT or FT_TERM event, returns the number of words in the text chunk. |
| Methods inherited from interface com.qizx.api.XMLPullStream |
|---|
getAttributeCount, getAttributeName, getAttributeValue, getCurrentEvent, getCurrentNode, getDTDName, getDTDPublicId, getDTDSystemId, getEncoding, getInternalSubset, getName, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getTarget, getText, getTextLength, moveToNextEvent |
| Field Detail |
|---|
static final int FT_TERM
| Method Detail |
|---|
int getTermPosition()
Example: in the following query, terms 'romeo' has position 0, and term 'juliet' has position 1.
. ftcontains "romeo juliet" all words
Note that excluded terms (following ftnot or not
in) are ignored.
int getWordCount()
int getQueryTermCount()
String[] getQueryTerms()
|
© 2010 Axyana Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||