Logo Search packages:      
Sourcecode: beagle version File versions  Download package

Lucene::Net::Index::SegmentReader Class Reference

Inheritance diagram for Lucene::Net::Index::SegmentReader:

Lucene::Net::Index::IndexReader

List of all members.


Detailed Description

<version>
Id
SegmentReader.cs,v 1.7 2006/10/02 17:09:00 joeshaw Exp
</version>

Definition at line 31 of file SegmentReader.cs.


Public Member Functions

void Close ()
 Closes files associated with this index. Also saves any new deletions to disk. No other methods should be called after this has been called.
int Delete (Term term)
 Deletes all documents containing
term
. This is useful if one uses a document field to hold a unique ID string for the document. Then to delete such a document, one merely constructs a term with the appropriate field and the unique ID string as its text and passes it to this method. See Delete(int) for information about when this deletion will become effective.
void Delete (int docNum)
 Deletes the document numbered
docNum
. Once a document is deleted it will not appear in TermDocs or TermPostitions enumerations. Attempts to read its field with the document method will result in an error. The presence of this document may still be reflected in the docFreq statistic, though this will be corrected eventually as the index is further modified.
void DeleteDocument (int docNum)
 Deletes the document numbered
docNum
. Once a document is deleted it will not appear in TermDocs or TermPostitions enumerations. Attempts to read its field with the document method will result in an error. The presence of this document may still be reflected in the docFreq statistic, though this will be corrected eventually as the index is further modified.
int DeleteDocuments (Term term)
 Deletes all documents containing
term
. This is useful if one uses a document field to hold a unique ID string for the document. Then to delete such a document, one merely constructs a term with the appropriate field and the unique ID string as its text and passes it to this method. See Delete(int) for information about when this deletion will become effective.
virtual Directory Directory ()
 Returns the directory this index resides in.
override int DocFreq (Term t)
 Returns the number of documents containing the term
t
.
override Document Document (int n)
 Returns the stored fields of the
n
th in this index.
abstract
System.Collections.ICollection 
GetFieldNames (FieldOption fldOption)
 Get a list of unique field names that exist in this index and have the specified field option information.
override
System.Collections.ICollection 
GetFieldNames (IndexReader.FieldOption fieldOption)
override
System.Collections.ICollection 
GetFieldNames (bool indexed)
override
System.Collections.ICollection 
GetFieldNames ()
virtual
System.Collections.ICollection 
GetIndexedFieldNames (bool storedTermVector)
override
System.Collections.ICollection 
GetIndexedFieldNames (Field.TermVector tvSpec)
override TermFreqVector GetTermFreqVector (int docNumber, System.String field)
 Return a term frequency vector for the specified document and field. The vector returned contains term numbers and frequencies for all terms in the specified field of this document, if the field had storeTermVector flag set. If the flag was not set, the method returns null.
override TermFreqVector[] GetTermFreqVectors (int docNumber)
 Return an array of term frequency vectors for the specified document. The array contains a vector for each vectorized field in the document. Each vector vector contains term numbers and frequencies for all terms in a given vectorized field. If no such fields existed, the method returns null.
virtual long GetVersion ()
 Version number when this IndexReader was opened.
override bool HasDeletions ()
 Returns true if any documents have been deleted.
override bool HasNorms (System.String field)
 Returns true if there are norms stored for this field.
virtual bool IsCurrent ()
 Check whether this IndexReader still works on a current version of the index. If this is not the case you will need to re-open the IndexReader to make sure you see the latest changes made to the index.
override bool IsDeleted (int n)
 Returns true if document n has been deleted.
override int MaxDoc ()
 Returns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.
override void Norms (System.String field, byte[] bytes, int offset)
 Read norms into a pre-allocated array.
override byte[] Norms (System.String field)
 Returns the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
override int NumDocs ()
 Returns the number of documents in this index.
virtual void SetNorm (int doc, System.String field, float value_Renamed)
 Expert: Resets the normalization factor for the named field of the named document.
void SetNorm (int doc, System.String field, byte value_Renamed)
 Expert: Resets the normalization factor for the named field of the named document. The norm represents the product of the field's boost and its int) length normalization. Thus, to preserve the length normalization values when resetting this, one should base the new value upon the old.
virtual TermDocs TermDocs (Term term)
 Returns an enumeration of all the documents which contain
term
. For each document, the document number, the frequency of the term in that document is also provided, for use in search scoring. Thus, this method implements the mapping:.
override TermDocs TermDocs ()
 Returns an unpositioned TermDocs enumerator.
virtual TermPositions TermPositions (Term term)
 Returns an enumeration of all the documents which contain
term
. For each document, in addition to the document number and frequency of the term in that document, a list of all of the ordinal positions of the term in the document is available. Thus, this method implements the mapping:.
override TermPositions TermPositions ()
 Returns an unpositioned TermPositions enumerator.
override TermEnum Terms (Term t)
 Returns an enumeration of all terms after a given term. The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.
override TermEnum Terms ()
 Returns an enumeration of all the terms in the index. The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.
void UndeleteAll ()
 Undeletes all documents currently marked as deleted in this index.

Static Public Member Functions

static SegmentReader Get (Directory dir, SegmentInfo si, SegmentInfos sis, bool closeDir, bool ownDir)
static SegmentReader Get (SegmentInfos sis, SegmentInfo si, bool closeDir)
static SegmentReader Get (SegmentInfo si)
static long GetCurrentVersion (Directory directory)
 Reads version number from segments files. The version number is initialized with a timestamp and then increased by one for each change of the index.
static long GetCurrentVersion (System.IO.FileInfo directory)
 Reads version number from segments files. The version number is initialized with a timestamp and then increased by one for each change of the index.
static long GetCurrentVersion (System.String directory)
 Reads version number from segments files. The version number is initialized with a timestamp and then increased by one for each change of the index.
static bool IndexExists (Directory directory)
 Returns
true
if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
static bool IndexExists (System.IO.FileInfo directory)
 Returns
true
if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
static bool IndexExists (System.String directory)
 Returns
true
if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
false
is returned.
static bool IsLocked (System.String directory)
 Returns
true
iff the index in the named directory is currently locked.
static bool IsLocked (Directory directory)
 Returns
true
iff the index in the named directory is currently locked.
static long LastModified (Directory directory)
 Returns the time the index in the named directory was last modified. Do not use this to check whether the reader is still up-to-date, use IsCurrent() instead.
static long LastModified (System.IO.FileInfo directory)
 Returns the time the index in the named directory was last modified. Do not use this to check whether the reader is still up-to-date, use IsCurrent() instead.
static long LastModified (System.String directory)
 Returns the time the index in the named directory was last modified. Do not use this to check whether the reader is still up-to-date, use IsCurrent() instead.
static void Main (System.String[] args)
 Prints the filename and size of each file within a given compound file. Add the -extract flag to extract files to the current working directory. In order to make the extracted version of the index work, you have to copy the segments file from the compound index into the directory where the extracted files are stored.
static IndexReader Open (Directory directory)
 Returns an IndexReader reading the index in the given Directory.
static IndexReader Open (System.IO.FileInfo path)
 Returns an IndexReader reading the index in an FSDirectory in the named path.
static IndexReader Open (System.String path)
 Returns an IndexReader reading the index in an FSDirectory in the named path.
static void Unlock (Directory directory)
 Forcibly unlocks the index in the named directory.

Protected Member Functions

internal void Commit ()
 Commit changes resulting from delete, undeleteAll, or setNorm operations.
internal override void DoClose ()
 Implements close.
internal override void DoCommit ()
 Implements commit.
internal override void DoDelete (int docNum)
 Implements deletion of the document numbered
docNum
. Applications should call Delete(int) or Delete(Term).
internal override void DoSetNorm (int doc, System.String field, byte value_Renamed)
 Implements setNorm in subclass.
internal override void DoUndeleteAll ()
 Implements actual undeleteAll() in subclass.
virtual internal byte[] GetNorms (System.String field)

Properties

FieldInfos FieldInfos [get]

Private Member Functions

void CloseNorms ()
byte[] FakeNorms ()
virtual internal
System.Collections.ArrayList 
Files ()
TermVectorsReader GetTermVectorsReader ()
 Create a clone from the initial TermVectorsReader and store it in the ThreadLocal.
void Initialize (SegmentInfo si)
void OpenNorms (Directory cfsDir)

Static Private Member Functions

static internal byte[] CreateFakeNorms (int size)
static internal bool HasDeletions (SegmentInfo si)
static internal bool HasSeparateNorms (SegmentInfo si)
static internal bool UsesCompoundFile (SegmentInfo si)

Private Attributes

internal CompoundFileReader cfsReader = null
internal BitVector deletedDocs = null
bool deletedDocsDirty = false
internal FieldInfos fieldInfos
FieldsReader fieldsReader
internal IndexInput freqStream
System.Collections.Hashtable norms = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable())
bool normsDirty = false
byte[] ones
internal IndexInput proxStream
System.String segment
internal System.LocalDataStoreSlot termVectorsLocal = System.Threading.Thread.AllocateDataSlot()
internal TermVectorsReader termVectorsReaderOrig = null
internal TermInfosReader tis
bool undeleteAll = false

Static Private Attributes

static System.Type IMPL
 The class which implements SegmentReader.

Classes

class  Norm

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

Generated by  Doxygen 1.6.0   Back to index