|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.indexing.impl.NGramIndexWorker
public class NGramIndexWorker
Each index entry maps a key (collectionId, ngram) to a list of occurrences, which has the following structure:
[docId : int, nameType: byte, occurrenceCount: int, entrySize: long, [id: NodeId, offset: int, ...]* ]
| Nested Class Summary | |
|---|---|
class |
NGramIndexWorker.NGramMatch
|
| Constructor Summary | |
|---|---|
NGramIndexWorker(NGramIndex index)
|
|
| Method Summary | |
|---|---|
Object |
configure(IndexController controller,
NodeList configNodes,
Map namespaces)
Read an index configuration from an collection.xconf configuration document. |
void |
flush()
Flush the index. |
String[] |
getDistinctNGrams(CharSequence text)
|
Index |
getIndex()
|
String |
getIndexId()
Returns an ID which uniquely identifies this index. |
String |
getIndexName()
Returns an name which uniquely identifies this index. |
StreamListener |
getListener(int mode,
DocumentImpl document)
Return a stream listener to index the specified document in the specified mode. |
MatchListener |
getMatchListener(NodeProxy proxy)
Returns a MatchListener, which can be used to filter
(and manipulate) the XML output generated by the serializer when serializing
query results. |
int |
getN()
|
StoredNode |
getReindexRoot(StoredNode node,
NodePath path,
boolean includeSelf)
When adding or removing nodes to or from the document tree, it might become necessary to reindex some parts of the tree, in particular if indexes are defined on mixed content nodes. |
void |
removeCollection(Collection collection)
Remove all indexes for the given collection, its subcollections and all resources.. |
Occurrences[] |
scanIndex(DocumentSet docs)
|
NodeSet |
search(int contextId,
DocumentSet docs,
List qnames,
String ngram,
XQueryContext context,
NodeSet contextSet,
int axis)
|
void |
setDocument(DocumentImpl document,
int newMode)
Notify this worker to operate on the specified document, using the mode given. |
String[] |
tokenize(CharSequence text)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NGramIndexWorker(NGramIndex index)
| Method Detail |
|---|
public String getIndexId()
IndexWorker
getIndexId in interface IndexWorkerpublic String getIndexName()
IndexWorker
getIndexName in interface IndexWorkerpublic Index getIndex()
public int getN()
public Object configure(IndexController controller,
NodeList configNodes,
Map namespaces)
throws DatabaseConfigurationException
IndexWorkerCollectionConfiguration while
reading the collection.xconf configuration file for a given collection. The configNodes
parameter lists all top-level child nodes below the <index> element in the
collection.xconf. The IndexWorker should scan this list and handle those elements
it understands.
The returned Object will be stored in the collection configuration structure associated
with each collection. It can later be retrieved from the collection configuration, e.g. to
check if a given node should be indexed or not.
configure in interface IndexWorkerconfigNodes - lists the top-level child nodes below the <index> element in collection.xconfnamespaces - the active prefix/namespace map
DatabaseConfigurationException - if a configuration error occurspublic void flush()
IndexWorker
flush in interface IndexWorkerpublic void removeCollection(Collection collection)
IndexWorker
removeCollection in interface IndexWorker
public NodeSet search(int contextId,
DocumentSet docs,
List qnames,
String ngram,
XQueryContext context,
NodeSet contextSet,
int axis)
throws TerminatedException
TerminatedExceptionpublic Occurrences[] scanIndex(DocumentSet docs)
scanIndex in interface IndexWorker
public StreamListener getListener(int mode,
DocumentImpl document)
IndexWorker
getListener in interface IndexWorkermode - one of StreamListener.STORE, StreamListener.REMOVE_NODES or
StreamListener.REMOVE_ALL_NODES.document - the document to be indexed.
public MatchListener getMatchListener(NodeProxy proxy)
IndexWorkerMatchListener, which can be used to filter
(and manipulate) the XML output generated by the serializer when serializing
query results. The method should return null if the implementation is not interested
in receiving serialization events.
getMatchListener in interface IndexWorkerproxy - the NodeProxy which is being serialized
public StoredNode getReindexRoot(StoredNode node,
NodePath path,
boolean includeSelf)
IndexWorkerIndexWorker.getReindexRoot(org.exist.dom.StoredNode, org.exist.storage.NodePath, boolean)
on each configured index. It will then return the top-most root.
getReindexRoot in interface IndexWorkernode - the node to be modified.path - path the NodePath of the nodeincludeSelf - if set to true, the current node itself will be included in the check
public String[] tokenize(CharSequence text)
public String[] getDistinctNGrams(CharSequence text)
public void setDocument(DocumentImpl document,
int newMode)
IndexWorkerStreamListener.STORE, StreamListener.REMOVE_NODES or
StreamListener.REMOVE_ALL_NODES.
setDocument in interface IndexWorkerdocument - the document which is processednewMode - the current operation mode
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||