Class query.ProxOp
All Packages Class Hierarchy This Package Previous Next Index
Class query.ProxOp
java.lang.Object
|
+----query.ExpNode
|
+----query.ProxOp
- public class ProxOp
- extends ExpNode
- implements STARTSnode, FilterNode, RankingNode
An ExpNode that represents a Proximity Operator in either a ranking
or filter expression. ProxOp nodes have two children (both of
which are always terms) and two properties:
distance - an integer value which is the proximity distance
wordOrderMatters - a boolean value determining whether
word order matters in the proximity
-
ProxOp(Query, int, boolean)
- Build a new ProxOp.
-
Check()
- Do sanity checking and source support checking for this
ProxOp.
-
ExtractTerms(Vector)
- Recurse through this sub-tree to extract the terms within
-
GetDistance()
- return the proximity distance
-
TranslateToFilter()
- Return a new ExpNode representing the source-specific
translation of this ProxOp in the context of a filter expression.
-
TranslateToRanking()
- Return a new ExpNode representing the source-specific
translation of this ProxOp in the context of a filter expression.
-
Unparse()
- Return the String representation of this proximity sub-tree
-
WordOrderMatters_p()
- predicate determining whether word order matters in this
proximity operator.
ProxOp
public ProxOp(Query query,
int distance,
boolean wordOrderMatters)
- Build a new ProxOp.
- Parameters:
- query - the query context of the ProxOp
- distance - integer distance value of the proximity operator
- wordOrderMatters - boolean value determining whether word
order matters inthe proximity
GetDistance
public int GetDistance()
- return the proximity distance
- Returns:
- the integer value of the proximity distance.
WordOrderMatters_p
public boolean WordOrderMatters_p()
- predicate determining whether word order matters in this
proximity operator.
- Returns:
- true or false depending if word order matters for this
proximity operator;
Unparse
public String Unparse()
- Return the String representation of this proximity sub-tree
- Returns:
- the String equivalent of this ProxOp rooted sub-tree
- Overrides:
- Unparse in class ExpNode
Check
public ExpNode Check() throws UnsupportedQueryException
- Do sanity checking and source support checking for this
ProxOp. For example, STARTS filter syntax does not prohibit
expressions like (author="foo") prox (title = "bar"). If
everything passes tests ok recurse down to the children.
- Returns:
- The transformed sub-tree resulting from the check operation
- Throws: UnsupportedQueryException
- if an error is found in the
subtree.
TranslateToFilter
public ExpNode TranslateToFilter() throws SourceQueryException
- Return a new ExpNode representing the source-specific
translation of this ProxOp in the context of a filter expression.
- Returns:
- The sub-tree that is the source filter equivalent of the
ProxOp sub-tree.
- Throws: SourceQueryException
- if an error occurs during the
translation.
TranslateToRanking
public ExpNode TranslateToRanking() throws SourceQueryException
- Return a new ExpNode representing the source-specific
translation of this ProxOp in the context of a filter expression.
- Returns:
- The sub-tree that is the source filter equivalent of the
ProxOp sub-tree.
- Throws: SourceQueryException
- if an error occurs during the
translation.
ExtractTerms
public void ExtractTerms(Vector termVector)
- Recurse through this sub-tree to extract the terms within
- Parameters:
- termVector - Vector of terms extracted.
All Packages Class Hierarchy This Package Previous Next Index