public class NodePhraseQuery extends NodePrimitiveQuery
NodePrimitiveQuery
that matches nodes containing a particular
sequence of terms. A NodePhraseQuery
is built for input like
"new york"
.
This query may be combined with other queries with a NodeBooleanQuery
or a TwigQuery
.
Code taken from PhraseQuery
and adapted for the Siren use case.
datatype
ancestor, levelConstraint, lowerBound, upperBound
Constructor and Description |
---|
NodePhraseQuery()
Constructs an empty phrase query.
|
Modifier and Type | Method and Description |
---|---|
void |
add(org.apache.lucene.index.Term term)
Adds a term to the end of the query phrase.
|
void |
add(org.apache.lucene.index.Term term,
int position)
Adds a term to the end of the query phrase.
|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.IndexSearcher searcher) |
boolean |
equals(Object o) |
void |
extractTerms(Set<org.apache.lucene.index.Term> queryTerms) |
int[] |
getPositions()
Returns the relative positions of terms in this phrase.
|
org.apache.lucene.index.Term[] |
getTerms()
Returns the set of terms in this phrase.
|
int |
hashCode() |
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader) |
String |
toString(String f) |
setDatatype, wrapToStringWithDatatype
getDocsNodesAndPositionsEnum, getLevelConstraint, getNodeConstraint, setAncestorPointer, setLevelConstraint, setNodeConstraint, setNodeConstraint
public void add(org.apache.lucene.index.Term term)
public void add(org.apache.lucene.index.Term term, int position)
term
- position
- public org.apache.lucene.index.Term[] getTerms()
public int[] getPositions()
public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
rewrite
in class org.apache.lucene.search.Query
IOException
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 void extractTerms(Set<org.apache.lucene.index.Term> queryTerms)
extractTerms
in class org.apache.lucene.search.Query
Query.extractTerms(java.util.Set)
public String toString(String f)
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.