public class GraphQuery extends Query
Modifier and Type | Class and Description |
---|---|
protected class |
GraphQuery.GraphQueryWeight |
Constructor and Description |
---|
GraphQuery(Query q,
String fromField,
String toField)
Create a graph query
q - the starting node query
fromField - the field containing the node id
toField - the field containing the edge ids
|
GraphQuery(Query q,
String fromField,
String toField,
Query traversalFilter)
Create a graph query with a traversal filter applied while traversing the frontier.
|
Modifier and Type | Method and Description |
---|---|
Weight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object other)
Override and implement query instance equivalence properly in a subclass.
|
String |
getFromField() |
int |
getMaxDepth() |
Query |
getQ() |
String |
getToField() |
Query |
getTraversalFilter() |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
boolean |
isOnlyLeafNodes() |
boolean |
isReturnRoot() |
boolean |
isUseAutn() |
void |
setFromField(String fromField) |
void |
setMaxDepth(int maxDepth) |
void |
setOnlyLeafNodes(boolean onlyLeafNodes) |
void |
setQ(Query q) |
void |
setReturnRoot(boolean returnRoot) |
void |
setToField(String toField) |
void |
setTraversalFilter(Query traversalFilter) |
void |
setUseAutn(boolean useAutn) |
String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
classHash, rewrite, sameClassAs, toString
public GraphQuery(Query q, String fromField, String toField)
public GraphQuery(Query q, String fromField, String toField, Query traversalFilter)
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
needsScores
- True if document scores (Scorer.score()
) or match
frequencies (Scorer.freq()
) are needed.IOException
public String toString(String field)
Query
field
assumed to be the
default field and omitted.public Query getTraversalFilter()
public void setTraversalFilter(Query traversalFilter)
public String getFromField()
public void setFromField(String fromField)
public String getToField()
public void setToField(String toField)
public int getMaxDepth()
public void setMaxDepth(int maxDepth)
public boolean isUseAutn()
public void setUseAutn(boolean useAutn)
public boolean isOnlyLeafNodes()
public void setOnlyLeafNodes(boolean onlyLeafNodes)
public boolean isReturnRoot()
public void setReturnRoot(boolean returnRoot)
public int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public boolean equals(Object other)
Query
QueryCache
works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals
in class Query
Query.sameClassAs(Object)
,
Query.classHash()