|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.queryParser.core.nodes.QueryNodeImpl org.apache.lucene.queryParser.core.nodes.BooleanQueryNode org.apache.lucene.queryParser.core.nodes.ProximityQueryNode
public class ProximityQueryNode
A ProximityQueryNode
represents a query where the terms should meet
specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER]
[INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]
TODO: Add this to the future standard Lucene parser/processor/builder
Nested Class Summary | |
---|---|
static class |
ProximityQueryNode.ProximityType
|
static class |
ProximityQueryNode.Type
|
Field Summary |
---|
Fields inherited from class org.apache.lucene.queryParser.core.nodes.QueryNodeImpl |
---|
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields |
Constructor Summary | |
---|---|
ProximityQueryNode(List<QueryNode> clauses,
CharSequence field,
ProximityQueryNode.Type type,
boolean inorder)
|
|
ProximityQueryNode(List<QueryNode> clauses,
CharSequence field,
ProximityQueryNode.Type type,
int distance,
boolean inorder)
|
Method Summary | |
---|---|
QueryNode |
cloneTree()
Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() method |
int |
getDistance()
|
CharSequence |
getField()
returns null if the field was not specified in the query string |
String |
getFieldAsString()
returns null if the field was not specified in the query string |
ProximityQueryNode.Type |
getProximityType()
|
boolean |
isInOrder()
|
void |
setField(CharSequence field)
|
CharSequence |
toQueryString(EscapeQuerySyntax escapeSyntaxParser)
convert to a query string understood by the query parser |
String |
toString()
Every implementation of this class should return pseudo xml like this: For FieldQueryNode: |
Methods inherited from class org.apache.lucene.queryParser.core.nodes.QueryNodeImpl |
---|
add, add, allocate, clone, containsTag, containsTag, getChildren, getParent, getTag, getTag, getTagMap, getTags, isDefaultField, isLeaf, isRoot, set, setLeaf, setTag, setTag, unsetTag, unsetTag |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProximityQueryNode(List<QueryNode> clauses, CharSequence field, ProximityQueryNode.Type type, int distance, boolean inorder)
clauses
- - QueryNode childrenfield
- - field nametype
- - type of proximity querydistance
- - positive integer that specifies the distanceinorder
- - true, if the tokens should be matched in the order of the
clausespublic ProximityQueryNode(List<QueryNode> clauses, CharSequence field, ProximityQueryNode.Type type, boolean inorder)
clauses
- - QueryNode childrenfield
- - field nametype
- - type of proximity queryinorder
- - true, if the tokens should be matched in the order of the
clausesMethod Detail |
---|
public ProximityQueryNode.Type getProximityType()
public String toString()
QueryNodeImpl
toString
in interface QueryNode
toString
in class BooleanQueryNode
QueryNode.toString()
public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
QueryNode
toQueryString
in interface QueryNode
toQueryString
in class BooleanQueryNode
public QueryNode cloneTree() throws CloneNotSupportedException
QueryNode
cloneTree
in interface QueryNode
cloneTree
in class BooleanQueryNode
CloneNotSupportedException
public int getDistance()
public CharSequence getField()
public String getFieldAsString()
public void setField(CharSequence field)
field
- the field to setpublic boolean isInOrder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |