MultiPhraseQuery
insteadpublic class PhrasePrefixQuery extends Query
add(Term[])
.
To use this class, to search for the phrase "Microsoft app*" first use
add(Term) on the term "Microsoft", then find all terms that has "app" as
prefix using IndexReader.terms(Term), and use PhrasePrefixQuery.add(Term[]
terms) to add them to the query.Constructor and Description |
---|
PhrasePrefixQuery()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Term term)
Deprecated.
Add a single term at the next position in the phrase.
|
void |
add(Term[] terms)
Deprecated.
Add multiple terms at the next position in the phrase.
|
void |
add(Term[] terms,
int position)
Deprecated.
Allows to specify the relative position of terms within the phrase.
|
protected Weight |
createWeight(Searcher searcher)
Deprecated.
Expert: Constructs an appropriate Weight implementation for this query.
|
int[] |
getPositions()
Deprecated.
Returns the relative positions of terms in this phrase.
|
int |
getSlop()
Deprecated.
Sets the phrase slop for this query.
|
void |
setSlop(int s)
Deprecated.
Sets the phrase slop for this query.
|
String |
toString(String f)
Deprecated.
Prints a user-readable version of this query.
|
clone, combine, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, weight
public void setSlop(int s)
PhraseQuery.setSlop(int)
public int getSlop()
PhraseQuery.getSlop()
public void add(Term term)
PhraseQuery.add(Term)
public void add(Term[] terms)
PhraseQuery.add(Term)
public void add(Term[] terms, int position)
terms
- position
- PhraseQuery.add(Term, int)
public int[] getPositions()
protected Weight createWeight(Searcher searcher) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.