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(Object o) |
Analyzer |
getAnalyzer()
Gets the analyzer used to analyze the prefix.
|
int |
hashCode() |
void |
visit(QueryVisitor visitor) |
getField, getFilter, getTerm, rewrite, toStringclassHash, sameClassAs, toStringprotected 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 IOException
createWeight in class QueryIOExceptionpublic void visit(QueryVisitor visitor)
public Analyzer getAnalyzer()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.