org.exist.dom
Class Match
java.lang.Object
org.exist.dom.Match
- All Implemented Interfaces:
- Comparable
- Direct Known Subclasses:
- NativeTextEngine.FtMatch, NGramIndexWorker.NGramMatch
public abstract class Match
- extends Object
- implements Comparable
Used to track fulltext matches throughout the query.
TextSearchEngine will add a
match object to every NodeProxy
that triggered a fulltext match for every term matched. The
Match object contains the nodeId of the text node that triggered the
match, the string value of the matching term and a frequency count,
indicating the frequency of the matching term string within the corresponding
single text node.
All path operations copy existing match objects, i.e. the match objects
are copied to the selected descendant or child nodes. This means that
every NodeProxy being the direct or indirect result of a fulltext
selection will have one or more match objects, indicating which text nodes
among its descendant nodes contained a fulltext match.
- Author:
- wolf
getNodeId
public NodeId getNodeId()
getFrequency
public int getFrequency()
getMatchTerm
public String getMatchTerm()
getContextId
public int getContextId()
createInstance
public abstract Match createInstance(int contextId,
NodeId nodeId,
String matchTerm)
newCopy
public abstract Match newCopy()
getIndexId
public abstract String getIndexId()
addOffset
public void addOffset(int offset,
int length)
getOffset
public Match.Offset getOffset(int pos)
isAfter
public Match isAfter(Match other)
getNextMatch
public Match getNextMatch()
equals
public boolean equals(Object other)
- Overrides:
equals in class Object
compareTo
public int compareTo(Object o)
- Used to sort matches. Terms are compared by their string
length to have the longest string first.
- Specified by:
compareTo in interface Comparable
- See Also:
Comparable.compareTo(java.lang.Object)
toString
public String toString()
- Overrides:
toString in class Object
Copyright (C) Wolfgang Meier. All rights reserved.