Class JaspellLookup
java.lang.Object
org.apache.lucene.search.suggest.Lookup
org.apache.lucene.search.suggest.jaspell.JaspellLookup
- All Implemented Interfaces:
Accountable
Deprecated.
Migrate to one of the newer suggesters which are much more RAM efficient.
Suggest implementation based on
JaSpell.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.suggest.Lookup
Lookup.LookupPriorityQueue, Lookup.LookupResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longDeprecated.Number of entries the lookup was built withprivate intDeprecated.private static final byteDeprecated.private static final byteDeprecated.private static final byteDeprecated.private static final byteDeprecated.(package private) JaspellTernarySearchTrieDeprecated.private booleanDeprecated.Fields inherited from class org.apache.lucene.search.suggest.Lookup
CHARSEQUENCE_COMPARATORFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(CharSequence key, Object value) Deprecated.Adds a new node ifkeyalready exists, otherwise replaces its value.voidbuild(InputIterator iterator) Deprecated.Builds up a new internalLookuprepresentation based on the givenInputIterator.get(CharSequence key) Deprecated.Returns the value for the specified key, or null if the key does not exist.longgetCount()Deprecated.Get the number of entries the lookup was built withbooleanDeprecated.Discard current lookup data and load it from a previously saved copy.lookup(CharSequence key, Set<BytesRef> contexts, boolean onlyMorePopular, int num) Deprecated.Look up a key and return possible completion for this key.longDeprecated.Return the memory usage of this object in bytes.private voidDeprecated.booleanstore(DataOutput output) Deprecated.Persist the constructed lookup data to a directory.private voidDeprecated.Methods inherited from class org.apache.lucene.search.suggest.Lookup
build, load, lookup, lookup, storeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
trie
Deprecated. -
usePrefix
private boolean usePrefixDeprecated. -
editDistance
private int editDistanceDeprecated. -
count
private long countDeprecated.Number of entries the lookup was built with -
LO_KID
private static final byte LO_KIDDeprecated.- See Also:
-
EQ_KID
private static final byte EQ_KIDDeprecated.- See Also:
-
HI_KID
private static final byte HI_KIDDeprecated.- See Also:
-
HAS_VALUE
private static final byte HAS_VALUEDeprecated.- See Also:
-
-
Constructor Details
-
JaspellLookup
public JaspellLookup()Deprecated.Creates a new empty trie- See Also:
-
-
Method Details
-
build
Deprecated.Description copied from class:LookupBuilds up a new internalLookuprepresentation based on the givenInputIterator. The implementation might re-sort the data internally.- Specified by:
buildin classLookup- Throws:
IOException
-
add
Deprecated.Adds a new node ifkeyalready exists, otherwise replaces its value.This method always returns false.
-
get
Deprecated.Returns the value for the specified key, or null if the key does not exist. -
lookup
public List<Lookup.LookupResult> lookup(CharSequence key, Set<BytesRef> contexts, boolean onlyMorePopular, int num) Deprecated.Description copied from class:LookupLook up a key and return possible completion for this key.- Specified by:
lookupin classLookup- Parameters:
key- lookup key. Depending on the implementation this may be a prefix, misspelling, or even infix.contexts- contexts to filter the lookup by, or null if all contexts are allowed; if the suggestion contains any of the contexts, it's a matchonlyMorePopular- return only more popular resultsnum- maximum number of results to return- Returns:
- a list of possible completions, with their relative weight (e.g. popularity)
-
readRecursively
private void readRecursively(DataInput in, JaspellTernarySearchTrie.TSTNode node) throws IOException Deprecated.- Throws:
IOException
-
writeRecursively
private void writeRecursively(DataOutput out, JaspellTernarySearchTrie.TSTNode node) throws IOException Deprecated.- Throws:
IOException
-
store
Deprecated.Description copied from class:LookupPersist the constructed lookup data to a directory. Optional operation.- Specified by:
storein classLookup- Parameters:
output-DataOutputto write the data to.- Returns:
- true if successful, false if unsuccessful or not supported.
- Throws:
IOException- when fatal IO error occurs.
-
load
Deprecated.Description copied from class:LookupDiscard current lookup data and load it from a previously saved copy. Optional operation.- Specified by:
loadin classLookup- Parameters:
input- theDataInputto load the lookup data.- Returns:
- true if completed successfully, false if unsuccessful or not supported.
- Throws:
IOException- when fatal IO error occurs.
-
ramBytesUsed
public long ramBytesUsed()Deprecated.Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
getCount
public long getCount()Deprecated.Description copied from class:LookupGet the number of entries the lookup was built with
-