public class NodeConstantScoreQuery extends NodePrimitiveQuery
Code taken from ConstantScoreQuery
and adapted for the siren use
case.
Modifier and Type | Class and Description |
---|---|
protected class |
NodeConstantScoreQuery.NodeConstantScorer |
protected class |
NodeConstantScoreQuery.NodeConstantWeight |
Modifier and Type | Field and Description |
---|---|
protected org.apache.lucene.search.Filter |
filter |
protected NodeQuery |
query |
datatype
ancestor, levelConstraint, lowerBound, upperBound
Constructor and Description |
---|
NodeConstantScoreQuery(NodeQuery query)
Strips off scores from the passed in Query.
|
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.IndexSearcher searcher) |
boolean |
equals(Object o) |
void |
extractTerms(Set<org.apache.lucene.index.Term> terms) |
NodeQuery |
getQuery()
Returns the encapsulated query, returns
null if a filter is wrapped. |
int |
hashCode() |
NodeQuery |
rewrite(org.apache.lucene.index.IndexReader reader) |
protected void |
setAncestorPointer(NodeQuery ancestor)
Expert: Add a pointer to the node query ancestor
|
void |
setLevelConstraint(int levelConstraint)
Set a constraint on the node's level
|
void |
setNodeConstraint(int lowerBound,
int upperBound)
Set an index interval constraint for a node.
|
String |
toString(String field) |
setDatatype, wrapToStringWithDatatype
getDocsNodesAndPositionsEnum, getLevelConstraint, getNodeConstraint, setNodeConstraint
protected final org.apache.lucene.search.Filter filter
protected final NodeQuery query
public NodeConstantScoreQuery(NodeQuery query)
public NodeQuery getQuery()
null
if a filter is wrapped.protected void setAncestorPointer(NodeQuery ancestor)
NodeQuery
The pointer to node query ancestor is used to retrieve node constraints from ancestors.
setAncestorPointer
in class NodeQuery
public void setNodeConstraint(int lowerBound, int upperBound)
NodeQuery
setNodeConstraint
in class NodeQuery
public void setLevelConstraint(int levelConstraint)
NodeQuery
Given that the root of the tree (level 0) is the document id, the node
level constraint ranges from 1 to Integer.MAX_VALUE
. A node
level constraint of 0 will always return false.
setLevelConstraint
in class NodeQuery
public NodeQuery rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
rewrite
in class org.apache.lucene.search.Query
IOException
public void extractTerms(Set<org.apache.lucene.index.Term> terms)
extractTerms
in class org.apache.lucene.search.Query
public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.IndexSearcher searcher) throws IOException
createWeight
in class org.apache.lucene.search.Query
IOException
public String toString(String field)
toString
in class org.apache.lucene.search.Query
public boolean equals(Object o)
equals
in class org.apache.lucene.search.Query
public int hashCode()
hashCode
in class org.apache.lucene.search.Query
Copyright © 2014. All rights reserved.