public class PrefixCompletionQuery extends CompletionQuery
CompletionQuery which takes an Analyzer
to analyze the prefix of the query term.
Example usage of querying an analyzed prefix 'sugg' against a field 'suggest_field' is as follows:
CompletionQuery query = new PrefixCompletionQuery(analyzer, new Term("suggest_field", "sugg"));
| Modifier and Type | Field and Description |
|---|---|
protected CompletionAnalyzer |
analyzer
Used to analyze the term text
|
| Constructor and Description |
|---|
PrefixCompletionQuery(Analyzer analyzer,
Term term)
Calls
PrefixCompletionQuery(Analyzer, Term, BitsProducer)
with no filter |
PrefixCompletionQuery(Analyzer analyzer,
Term term,
BitsProducer filter)
Constructs an analyzed prefix completion query
|
| Modifier and Type | Method and Description |
|---|---|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost) |
boolean |
equals(java.lang.Object o) |
Analyzer |
getAnalyzer()
Gets the analyzer used to analyze the prefix.
|
int |
hashCode() |
void |
visit(QueryVisitor visitor) |
protected final CompletionAnalyzer analyzer
public PrefixCompletionQuery(Analyzer analyzer,
Term term)
PrefixCompletionQuery(Analyzer, Term, BitsProducer)
with no filterpublic PrefixCompletionQuery(Analyzer analyzer,
Term term,
BitsProducer filter)
analyzer - used to analyze the provided Term#text()term - query is run against Term#field() and Term#text()
is analyzed with analyzerfilter - used to query on a sub set of documentspublic Weight createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
throws java.io.IOException
java.io.IOExceptionpublic void visit(QueryVisitor visitor)
public Analyzer getAnalyzer()
public boolean equals(java.lang.Object o)
public int hashCode()
Data In Motion GmbH all rights reserved