|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.suggest.fst.FSTCompletion
public class FSTCompletion
Finite state automata based implementation of "autocomplete" functionality.
FSTCompletionBuilder
Nested Class Summary | |
---|---|
static class |
FSTCompletion.Completion
A single completion for a given key. |
Field Summary | |
---|---|
static int |
DEFAULT_BUCKETS
Default number of buckets. |
Constructor Summary | |
---|---|
FSTCompletion(FST<Object> automaton)
Defaults to higher weights first and exact first. |
|
FSTCompletion(FST<Object> automaton,
boolean higherWeightsFirst,
boolean exactFirst)
|
Method Summary | |
---|---|
int |
getBucket(CharSequence key)
Returns the bucket assigned to a given key (if found) or -1 if
no exact match exists. |
int |
getBucketCount()
Returns the bucket count (discretization thresholds). |
FST<Object> |
getFST()
Returns the internal automaton. |
List<FSTCompletion.Completion> |
lookup(CharSequence key,
int num)
Lookup suggestions to key . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUCKETS
Constructor Detail |
---|
public FSTCompletion(FST<Object> automaton, boolean higherWeightsFirst, boolean exactFirst)
automaton
- Automaton with completions. See FSTCompletionBuilder
.higherWeightsFirst
- Return most popular suggestions first. This is the default
behavior for this implementation. Setting it to false
has no effect (use constant term weights to sort alphabetically
only).exactFirst
- Find and push an exact match to the first position of the result
list if found.public FSTCompletion(FST<Object> automaton)
FSTCompletion(FST, boolean, boolean)
Method Detail |
---|
public List<FSTCompletion.Completion> lookup(CharSequence key, int num)
key
.
key
- The prefix to which suggestions should be sought.num
- At most this number of suggestions will be returned.
public int getBucketCount()
public int getBucket(CharSequence key)
-1
if
no exact match exists.
public FST<Object> getFST()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |