public abstract class QueryTree extends Object
advancePhase(double)
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(String reason)
Returns a leaf node that will match any document
|
abstract void |
collectTerms(BiConsumer<String,BytesRef> termCollector)
Collect terms from the most highly-weighted path below this node
|
static QueryTree |
conjunction(List<Function<TermWeightor,QueryTree>> children,
TermWeightor weightor)
Returns a conjunction of a set of child nodes
|
static QueryTree |
disjunction(List<Function<TermWeightor,QueryTree>> children,
TermWeightor weightor)
Returns a disjunction of a set of child nodes
|
protected String |
space(int width)
Returns a string of
width spaces |
static QueryTree |
term(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
|
String |
toString() |
abstract 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(BiConsumer<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 String toString(int depth)
depth
- the current depth of this node in the overall query treeprotected 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(String field, BytesRef term, double weight)
public static QueryTree anyTerm(String reason)
public static QueryTree conjunction(List<Function<TermWeightor,QueryTree>> children, TermWeightor weightor)
public static QueryTree disjunction(List<Function<TermWeightor,QueryTree>> children, TermWeightor weightor)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.