Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Classes | Public Member Functions | Properties | List of all members
Lucene.Net.Search.FieldCacheImpl Class Reference

Expert: The default cache implementation, storing all values in memory. A WeakDictionary is used for storage. More...

Inherits Lucene.Net.Search.FieldCache.

Classes

class  ByteCache
 
class  Cache
 Expert: Internal cache.
 
class  DoubleCache
 
class  Entry
 Expert: Every composite-key in the internal cache is of this type.
 
class  FloatCache
 
class  IntCache
 
class  LongCache
 
class  ShortCache
 
class  StopFillCacheException
 Hack: When thrown from a Parser (NUMERIC_UTILS_* ones), this stops processing terms and returns the current FieldCache array.
 
class  StringCache
 
class  StringIndexCache
 

Public Member Functions

virtual void PurgeAllCaches ()
 EXPERT: Instructs the FieldCache to forcibly expunge all entries from the underlying caches. This is intended only to be used for test methods as a way to ensure a known base state of the Cache (with out needing to rely on GC to free WeakReferences). It should not be relied on for "Cache maintenance" in general application code. EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.
 
void Purge (IndexReader r)
 Expert: drops all cache entries associated with this reader. NOTE: this reader must precisely match the reader that the cache entry is keyed on. If you pass a top-level reader, it usually will have no effect as Lucene now caches at the segment reader level.
 
virtual CacheEntry[] GetCacheEntries ()
 EXPERT: Generates an array of CacheEntry objects representing all items currently in the FieldCache. NOTE: These CacheEntry objects maintain a strong refrence to the Cached Values. Maintaining refrences to a CacheEntry the IndexReader associated with it has garbage collected will prevent the Value itself from being garbage collected when the Cache drops the WeakRefrence. EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.
 
virtual sbyte[] GetBytes (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as a single byte and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual sbyte[] GetBytes (IndexReader reader, System.String field, ByteParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as bytes and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual short[] GetShorts (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual short[] GetShorts (IndexReader reader, System.String field, ShortParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual int[] GetInts (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual int[] GetInts (IndexReader reader, System.String field, IntParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual float[] GetFloats (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual float[] GetFloats (IndexReader reader, System.String field, FloatParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual long[] GetLongs (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as longs and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual long[] GetLongs (IndexReader reader, System.String field, Lucene.Net.Search.LongParser parser)
 
virtual double[] GetDoubles (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
virtual double[] GetDoubles (IndexReader reader, System.String field, Lucene.Net.Search.DoubleParser parser)
 
virtual System.String[] GetStrings (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field and returns an array of size reader.MaxDoc containing the value each document has in the given field.
 
virtual StringIndex GetStringIndex (IndexReader reader, System.String field)
 Checks the internal cache for an appropriate entry, and if none is found reads the term values in field and returns an array of them in natural order, along with an array telling which element in the term array each document uses.
 
- Public Member Functions inherited from Lucene.Net.Search.FieldCache
long[] GetLongs (IndexReader reader, System.String field, LongParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as longs and returns an array of size reader.MaxDoc of the value each document has in the given field.
 
double[] GetDoubles (IndexReader reader, System.String field, DoubleParser parser)
 Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as doubles and returns an array of size reader.MaxDoc of the value each document has in the given field.
 

Properties

virtual StreamWriter InfoStream [get, set]
 
- Properties inherited from Lucene.Net.Search.FieldCache
StreamWriter InfoStream [get, set]
 Gets or sets the InfoStream for this FieldCache.
 

Detailed Description

Expert: The default cache implementation, storing all values in memory. A WeakDictionary is used for storage.

Created: May 19, 2004 4:40:36 PM

<since> lucene 1.4 </since>

Definition at line 43 of file FieldCacheImpl.cs.

Member Function Documentation

virtual sbyte [] Lucene.Net.Search.FieldCacheImpl.GetBytes ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as a single byte and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the single byte values.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 327 of file FieldCacheImpl.cs.

virtual sbyte [] Lucene.Net.Search.FieldCacheImpl.GetBytes ( IndexReader  reader,
System.String  field,
ByteParser  parser 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as bytes and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the bytes.
parserComputes byte for string values.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 333 of file FieldCacheImpl.cs.

virtual CacheEntry [] Lucene.Net.Search.FieldCacheImpl.GetCacheEntries ( )
virtual

EXPERT: Generates an array of CacheEntry objects representing all items currently in the FieldCache. NOTE: These CacheEntry objects maintain a strong refrence to the Cached Values. Maintaining refrences to a CacheEntry the IndexReader associated with it has garbage collected will prevent the Value itself from being garbage collected when the Cache drops the WeakRefrence. EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.

Implements Lucene.Net.Search.FieldCache.

Definition at line 95 of file FieldCacheImpl.cs.

virtual double [] Lucene.Net.Search.FieldCacheImpl.GetDoubles ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the doubles.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 662 of file FieldCacheImpl.cs.

virtual double [] Lucene.Net.Search.FieldCacheImpl.GetDoubles ( IndexReader  reader,
System.String  field,
Lucene.Net.Search.DoubleParser  parser 
)
virtual

Definition at line 668 of file FieldCacheImpl.cs.

virtual float [] Lucene.Net.Search.FieldCacheImpl.GetFloats ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the floats.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 517 of file FieldCacheImpl.cs.

virtual float [] Lucene.Net.Search.FieldCacheImpl.GetFloats ( IndexReader  reader,
System.String  field,
FloatParser  parser 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the floats.
parserComputes float for string values.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 523 of file FieldCacheImpl.cs.

virtual int [] Lucene.Net.Search.FieldCacheImpl.GetInts ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the integers.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 444 of file FieldCacheImpl.cs.

virtual int [] Lucene.Net.Search.FieldCacheImpl.GetInts ( IndexReader  reader,
System.String  field,
IntParser  parser 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the integers.
parserComputes integer for string values.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 450 of file FieldCacheImpl.cs.

virtual long [] Lucene.Net.Search.FieldCacheImpl.GetLongs ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as longs and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the longs.
Returns
The values in the given field for each document.

<throws> java.io.IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 590 of file FieldCacheImpl.cs.

virtual long [] Lucene.Net.Search.FieldCacheImpl.GetLongs ( IndexReader  reader,
System.String  field,
Lucene.Net.Search.LongParser  parser 
)
virtual

Definition at line 596 of file FieldCacheImpl.cs.

virtual short [] Lucene.Net.Search.FieldCacheImpl.GetShorts ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the shorts.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 385 of file FieldCacheImpl.cs.

virtual short [] Lucene.Net.Search.FieldCacheImpl.GetShorts ( IndexReader  reader,
System.String  field,
ShortParser  parser 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.MaxDoc of the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the shorts.
parserComputes short for string values.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 391 of file FieldCacheImpl.cs.

virtual StringIndex Lucene.Net.Search.FieldCacheImpl.GetStringIndex ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found reads the term values in field and returns an array of them in natural order, along with an array telling which element in the term array each document uses.

Parameters
readerUsed to get field values.
fieldWhich field contains the strings.
Returns
Array of terms and index into the array for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 778 of file FieldCacheImpl.cs.

virtual System.String [] Lucene.Net.Search.FieldCacheImpl.GetStrings ( IndexReader  reader,
System.String  field 
)
virtual

Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field and returns an array of size reader.MaxDoc containing the value each document has in the given field.

Parameters
readerUsed to get field values.
fieldWhich field contains the strings.
Returns
The values in the given field for each document.

<throws> IOException If any error occurs. </throws>

Implements Lucene.Net.Search.FieldCache.

Definition at line 734 of file FieldCacheImpl.cs.

void Lucene.Net.Search.FieldCacheImpl.Purge ( IndexReader  r)

Expert: drops all cache entries associated with this reader. NOTE: this reader must precisely match the reader that the cache entry is keyed on. If you pass a top-level reader, it usually will have no effect as Lucene now caches at the segment reader level.

Implements Lucene.Net.Search.FieldCache.

Definition at line 81 of file FieldCacheImpl.cs.

virtual void Lucene.Net.Search.FieldCacheImpl.PurgeAllCaches ( )
virtual

EXPERT: Instructs the FieldCache to forcibly expunge all entries from the underlying caches. This is intended only to be used for test methods as a way to ensure a known base state of the Cache (with out needing to rely on GC to free WeakReferences). It should not be relied on for "Cache maintenance" in general application code. EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.

Implements Lucene.Net.Search.FieldCache.

Definition at line 70 of file FieldCacheImpl.cs.

Property Documentation

virtual StreamWriter Lucene.Net.Search.FieldCacheImpl.InfoStream
getset

Definition at line 853 of file FieldCacheImpl.cs.


The documentation for this class was generated from the following file: