public abstract class QueryTree
extends java.lang.Object
advancePhase(double)
Modifier and Type | Class and Description |
---|---|
private static class |
QueryTree.ConjunctionQueryTree |
private static class |
QueryTree.DisjunctionQueryTree |
Constructor and Description |
---|
QueryTree() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
advancePhase(double minWeight)
Find the next-most highly-weighted path below this node
|
static QueryTree |
anyTerm(java.lang.String reason)
Returns a leaf node that will match any document
|
abstract void |
collectTerms(java.util.function.BiConsumer<java.lang.String,BytesRef> termCollector)
Collect terms from the most highly-weighted path below this node
|
static QueryTree |
conjunction(java.util.List<java.util.function.Function<TermWeightor,QueryTree>> children,
TermWeightor weightor)
Returns a conjunction of a set of child nodes
|
(package private) static QueryTree |
conjunction(QueryTree... children) |
static QueryTree |
disjunction(java.util.List<java.util.function.Function<TermWeightor,QueryTree>> children,
TermWeightor weightor)
Returns a disjunction of a set of child nodes
|
(package private) static QueryTree |
disjunction(QueryTree... children) |
protected java.lang.String |
space(int width)
Returns a string of
width spaces |
static QueryTree |
term(java.lang.String field,
BytesRef term,
double weight)
Returns a leaf node for a particular term and weight
The weight must be greater than 0
|
static QueryTree |
term(Term term,
double weight)
Returns a leaf node for a particular term and weight
The weight must be greater than 0
|
static QueryTree |
term(Term term,
TermWeightor weightor)
Returns a leaf node for a particular term
|
java.lang.String |
toString() |
abstract java.lang.String |
toString(int depth)
Returns a string representation of the node
|
abstract double |
weight()
The weight of this node
|
public abstract double weight()
public abstract void collectTerms(java.util.function.BiConsumer<java.lang.String,BytesRef> termCollector)
public abstract boolean advancePhase(double minWeight)
minWeight
- do not advance if the next path has a weight below this valuefalse
if there are no more paths above the minimum weightpublic abstract java.lang.String toString(int depth)
depth
- the current depth of this node in the overall query treepublic java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String space(int width)
width
spacespublic static QueryTree term(Term term, TermWeightor weightor)
public static QueryTree term(Term term, double weight)
public static QueryTree term(java.lang.String field, BytesRef term, double weight)
public static QueryTree anyTerm(java.lang.String reason)
public static QueryTree conjunction(java.util.List<java.util.function.Function<TermWeightor,QueryTree>> children, TermWeightor weightor)
public static QueryTree disjunction(java.util.List<java.util.function.Function<TermWeightor,QueryTree>> children, TermWeightor weightor)