Class Lookup
Simple Lookup interface for
Inheritance
Namespace: Lucene.Net.Search.Suggest
Assembly: Lucene.Net.Suggest.dll
Syntax
public abstract class Lookup : object
Constructors
| Improve this Doc View SourceLookup()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
public Lookup()
Fields
| Improve this Doc View SourceCHARSEQUENCE_COMPARER
A simple char-by-char comparer for
Declaration
public static readonly IComparer<string> CHARSEQUENCE_COMPARER
Field Value
Type | Description |
---|---|
IComparer<System. |
Properties
| Improve this Doc View SourceCount
Get the number of entries the lookup was built with
Declaration
public abstract long Count { get; }
Property Value
Type | Description |
---|---|
System. |
total number of suggester entries |
Methods
| Improve this Doc View SourceBuild(IDictionary)
Build lookup from a dictionary. Some implementations may require sorted
or unsorted keys from the dictionary's iterator - use
Sorted
Declaration
public virtual void Build(IDictionary dict)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | dict |
Build(IInputIterator)
Builds up a new internal Lookup representation based on the given IInput
Declaration
public abstract void Build(IInputIterator inputIterator)
Parameters
Type | Name | Description |
---|---|---|
IInput |
inputIterator |
DoLookup(String, IEnumerable<BytesRef>, Boolean, Int32)
Look up a key and return possible completion for this key.
Declaration
public abstract IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | lookup key. Depending on the implementation this may be a prefix, misspelling, or even infix. |
IEnumerable<Bytes |
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 match |
System. |
onlyMorePopular | return only more popular results |
System. |
num | maximum number of results to return |
Returns
Type | Description |
---|---|
IList<Lookup. |
a list of possible completions, with their relative weight (e.g. popularity) |
DoLookup(String, Boolean, Int32)
Look up a key and return possible completion for this key.
Declaration
public virtual IList<Lookup.LookupResult> DoLookup(string key, bool onlyMorePopular, int num)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | lookup key. Depending on the implementation this may be a prefix, misspelling, or even infix. |
System. |
onlyMorePopular | return only more popular results |
System. |
num | maximum number of results to return |
Returns
Type | Description |
---|---|
IList<Lookup. |
a list of possible completions, with their relative weight (e.g. popularity) |
GetSizeInBytes()
Get the size of the underlying lookup implementation in memory
Declaration
public abstract long GetSizeInBytes()
Returns
Type | Description |
---|---|
System. |
ram size of the lookup implementation in bytes |
Load(DataInput)
Discard current lookup data and load it from a previously saved copy. Optional operation.
Declaration
public abstract bool Load(DataInput input)
Parameters
Type | Name | Description |
---|---|---|
Data |
input | the |
Returns
Type | Description |
---|---|
System. |
true if completed successfully, false if unsuccessful or not supported. |
Load(Stream)
Calls Load(Data
Declaration
public virtual bool Load(Stream input)
Parameters
Type | Name | Description |
---|---|---|
Stream | input |
Returns
Type | Description |
---|---|
System. |
Store(DataOutput)
Persist the constructed lookup data to a directory. Optional operation.
Declaration
public abstract bool Store(DataOutput output)
Parameters
Type | Name | Description |
---|---|---|
Data |
output |
Returns
Type | Description |
---|---|
System. |
true if successful, false if unsuccessful or not supported. |
Store(Stream)
Calls Store(Data
Declaration
public virtual bool Store(Stream output)
Parameters
Type | Name | Description |
---|---|---|
Stream | output |
Returns
Type | Description |
---|---|
System. |