org.exist.dom
Class Match

java.lang.Object
  extended byorg.exist.dom.Match
All Implemented Interfaces:
java.lang.Comparable

public class Match
extends java.lang.Object
implements java.lang.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

Nested Class Summary
static class Match.Offset
           
 
Constructor Summary
Match(Match match)
           
Match(NodeId nodeId, java.lang.String matchTerm)
           
Match(NodeId nodeId, java.lang.String matchTerm, int frequency)
           
 
Method Summary
 void addOffset(int offset, int length)
           
 int compareTo(java.lang.Object o)
          Used to sort matches.
 boolean equals(java.lang.Object other)
           
 int getFrequency()
           
 Match getNextMatch()
           
 NodeId getNodeId()
           
 Match.Offset getOffset(int pos)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Match

public Match(NodeId nodeId,
             java.lang.String matchTerm)

Match

public Match(NodeId nodeId,
             java.lang.String matchTerm,
             int frequency)

Match

public Match(Match match)
Method Detail

getNodeId

public NodeId getNodeId()

getFrequency

public int getFrequency()

addOffset

public void addOffset(int offset,
                      int length)

getOffset

public Match.Offset getOffset(int pos)

getNextMatch

public Match getNextMatch()

equals

public boolean equals(java.lang.Object other)

compareTo

public int compareTo(java.lang.Object o)
Used to sort matches. Terms are compared by their string length to have the longest string first.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)


Copyright (C) Wolfgang Meier. All rights reserved.