|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.exist.storage.TextSearchEngine
This is the base class for all classes providing access to the fulltext index. The class has methods to add text and attribute nodes to the fulltext index, or to search for nodes matching selected search terms.
| Field Summary | |
protected DBBroker |
broker
|
protected Configuration |
config
|
protected boolean |
indexNumbers
|
protected static Logger |
LOG
|
protected boolean |
stem
|
protected PorterStemmer |
stemmer
|
protected java.util.TreeSet |
stoplist
|
protected boolean |
termFreq
|
protected Tokenizer |
tokenizer
|
protected int |
trackMatches
|
| Constructor Summary | |
TextSearchEngine(DBBroker broker,
Configuration conf)
Construct a new instance and configure it. |
|
| Method Summary | |
abstract boolean |
close()
|
abstract void |
dropIndex(Collection collection)
Remove index entries for an entire collection. |
abstract void |
dropIndex(DocumentImpl doc)
Remove all index entries for the given document. |
abstract void |
flush()
|
abstract java.lang.String[] |
getIndexTerms(DocumentSet docs,
TermMatcher matcher)
|
abstract NodeSet |
getNodes(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
TermMatcher matcher,
java.lang.CharSequence startTerm)
|
NodeSet |
getNodesContaining(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
java.lang.String expr)
For each of the given search terms and each of the documents in the document set, return a node-set of matching nodes. |
abstract NodeSet |
getNodesContaining(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
java.lang.String expr,
int type)
For each of the given search terms and each of the documents in the document set, return a node-set of matching nodes. |
Tokenizer |
getTokenizer()
Returns the Tokenizer used for tokenizing strings into words. |
int |
getTrackMatches()
|
abstract void |
reindex(DocumentImpl oldDoc,
StoredNode node)
Reindex a document or node. |
abstract Occurrences[] |
scanIndexTerms(DocumentSet docs,
NodeSet contextSet,
java.lang.String start,
java.lang.String end)
Queries the fulltext index to retrieve information on indexed words contained in the index for the current collection. |
void |
setTrackMatches(int flags)
|
abstract void |
storeAttribute(FulltextIndexSpec idx,
AttrImpl text)
Tokenize and index the given attribute node. |
abstract void |
storeText(FulltextIndexSpec idx,
TextImpl text,
boolean onetoken)
Tokenize and index the given text node. |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final Logger LOG
protected java.util.TreeSet stoplist
protected DBBroker broker
protected Tokenizer tokenizer
protected Configuration config
protected boolean indexNumbers
protected boolean stem
protected boolean termFreq
protected PorterStemmer stemmer
protected int trackMatches
| Constructor Detail |
public TextSearchEngine(DBBroker broker,
Configuration conf)
broker - conf - | Method Detail |
public Tokenizer getTokenizer()
public abstract void storeText(FulltextIndexSpec idx,
TextImpl text,
boolean onetoken)
idx - text -
public abstract void storeAttribute(FulltextIndexSpec idx,
AttrImpl text)
idx - text - public abstract void flush()
public abstract boolean close()
throws DBException
DBExceptionpublic int getTrackMatches()
public void setTrackMatches(int flags)
public NodeSet getNodesContaining(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
java.lang.String expr)
throws TerminatedException
expr -
TerminatedException
public abstract NodeSet getNodesContaining(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
java.lang.String expr,
int type)
throws TerminatedException
expr -
TerminatedException
public abstract NodeSet getNodes(XQueryContext context,
DocumentSet docs,
NodeSet contextSet,
TermMatcher matcher,
java.lang.CharSequence startTerm)
throws TerminatedException
TerminatedException
public abstract Occurrences[] scanIndexTerms(DocumentSet docs,
NodeSet contextSet,
java.lang.String start,
java.lang.String end)
throws PermissionDeniedException
Occurrences for all
words contained in the index. If is null, all words starting with
the string sequence are returned. Otherwise, the method
returns all words that come after start and before end in lexical order.
PermissionDeniedException
public abstract java.lang.String[] getIndexTerms(DocumentSet docs,
TermMatcher matcher)
public abstract void dropIndex(Collection collection)
collection - public abstract void dropIndex(DocumentImpl doc)
doc -
public abstract void reindex(DocumentImpl oldDoc,
StoredNode node)
oldDoc - node -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||