|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.spelling.suggest.Lookup
public abstract class Lookup
Nested Class Summary | |
---|---|
static class |
Lookup.LookupPriorityQueue
|
static class |
Lookup.LookupResult
Result of a lookup. |
Constructor Summary | |
---|---|
Lookup()
|
Method Summary | |
---|---|
abstract boolean |
add(String key,
Object value)
Modify the lookup data by recording additional data. |
void |
build(Dictionary dict)
Build lookup from a dictionary. |
protected abstract void |
build(TermFreqIterator tfit)
|
abstract Object |
get(String key)
Get value associated with a specific key. |
abstract void |
init(NamedList config,
SolrCore core)
Initialize the lookup. |
abstract boolean |
load(File storeDir)
Discard current lookup data and load it from a previously saved copy. |
abstract List<Lookup.LookupResult> |
lookup(String key,
boolean onlyMorePopular,
int num)
Look up a key and return possible completion for this key. |
abstract boolean |
store(File storeDir)
Persist the constructed lookup data to a directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lookup()
Method Detail |
---|
public abstract void init(NamedList config, SolrCore core)
public void build(Dictionary dict) throws IOException
SortedTermFreqIteratorWrapper
or
UnsortedTermFreqIteratorWrapper
in such case.
IOException
protected abstract void build(TermFreqIterator tfit) throws IOException
IOException
public abstract boolean store(File storeDir) throws IOException
storeDir
- directory where data can be stored.
IOException
- when fatal IO error occurs.public abstract boolean load(File storeDir) throws IOException
storeDir
- directory where lookup data was stored.
IOException
- when fatal IO error occurs.public abstract List<Lookup.LookupResult> lookup(String key, boolean onlyMorePopular, int num)
key
- lookup key. Depending on the implementation this may be
a prefix, misspelling, or even infix.onlyMorePopular
- return only more popular resultsnum
- maximum number of results to return
public abstract boolean add(String key, Object value)
key
- new lookup keyvalue
- value to associate with this key
public abstract Object get(String key)
key
- lookup key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |