Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Properties | List of all members
Lucene.Net.Index.SegmentsGenCommit Class Reference

Class that will force an index writer to open an index based on the generation in the segments.gen file as opposed to the highest generation found in a directory listing. More...

Inherits Lucene.Net.Index.IndexCommit.

Public Member Functions

 SegmentsGenCommit (Directory d)
 Ctor.
 
override void Delete ()
 Delete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy. Upon calling this, the writer is notified that this commit point should be deleted. Decision that a commit-point should be deleted is taken by the IndexDeletionPolicy in effect and therefore this should only be called by its IndexDeletionPolicy.OnInit{T}(IList{T}) or IndexDeletionPolicy.OnCommit{T}(IList{T}) methods.
 
- Public Member Functions inherited from Lucene.Net.Index.IndexCommit
override bool Equals (System.Object other)
 Two IndexCommits are equal if both their Directory and versions are equal.
 
override int GetHashCode ()
 

Properties

override string SegmentsFileName [get]
 Get the segments_n file for the generation found in the segments.gen file.
 
override long Generation [get]
 
override ICollection< string > FileNames [get]
 
override Directory Directory [get]
 
override bool IsDeleted [get]
 
override bool IsOptimized [get]
 
override long Version [get]
 
override IDictionary< string,
string > 
UserData [get]
 
- Properties inherited from Lucene.Net.Index.IndexCommit
abstract string SegmentsFileName [get]
 Get the segments file (segments_N) associated with this commit point.
 
abstract ICollection< string > FileNames [get]
 Returns all index files referenced by this commit point.
 
abstract Directory Directory [get]
 Returns the Store.Directory for the index.
 
abstract bool IsDeleted [get]
 
abstract bool IsOptimized [get]
 Returns true if this commit is an optimized index.
 
abstract long Version [get]
 Returns the version for this IndexCommit. This is the same value that IndexReader.Version would return if it were opened on this commit.
 
abstract long Generation [get]
 Returns the generation (the _N in segments_N) for this IndexCommit
 
virtual long Timestamp [get]
 Convenience method that returns the last modified time of the segments_N file corresponding to this index commit, equivalent to getDirectory().fileModified(getSegmentsFileName()).
 
abstract IDictionary< string,
string > 
UserData [get]
 Returns userData, previously passed to IndexWriter.Commit(System.Collections.Generic.IDictionary{string, string}) for this commit. IDictionary is String -> String.
 

Detailed Description

Class that will force an index writer to open an index based on the generation in the segments.gen file as opposed to the highest generation found in a directory listing.

A use case for using this IndexCommit when opening an IndexWriter would be if index snapshots (source) are being copied over an existing index (target) and the source now has a lower generation than the target due to initiating a rebuild of the index.

Definition at line 37 of file SegmentsGenCommit.cs.

Constructor & Destructor Documentation

Lucene.Net.Index.SegmentsGenCommit.SegmentsGenCommit ( Directory  d)

Ctor.

Parameters
dThe index directory.

Definition at line 53 of file SegmentsGenCommit.cs.

Member Function Documentation

override void Lucene.Net.Index.SegmentsGenCommit.Delete ( )
virtual

Delete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy. Upon calling this, the writer is notified that this commit point should be deleted. Decision that a commit-point should be deleted is taken by the IndexDeletionPolicy in effect and therefore this should only be called by its IndexDeletionPolicy.OnInit{T}(IList{T}) or IndexDeletionPolicy.OnCommit{T}(IList{T}) methods.

Implements Lucene.Net.Index.IndexCommit.

Definition at line 128 of file SegmentsGenCommit.cs.

Property Documentation

override Directory Lucene.Net.Index.SegmentsGenCommit.Directory
get

Definition at line 89 of file SegmentsGenCommit.cs.

override ICollection<string> Lucene.Net.Index.SegmentsGenCommit.FileNames
get

Definition at line 81 of file SegmentsGenCommit.cs.

override long Lucene.Net.Index.SegmentsGenCommit.Generation
get

Definition at line 73 of file SegmentsGenCommit.cs.

override bool Lucene.Net.Index.SegmentsGenCommit.IsDeleted
get

Definition at line 134 of file SegmentsGenCommit.cs.

override bool Lucene.Net.Index.SegmentsGenCommit.IsOptimized
get

Definition at line 142 of file SegmentsGenCommit.cs.

override string Lucene.Net.Index.SegmentsGenCommit.SegmentsFileName
get

Get the segments_n file for the generation found in the segments.gen file.

Returns
The segments_n file to use.

Definition at line 65 of file SegmentsGenCommit.cs.

override IDictionary<string, string> Lucene.Net.Index.SegmentsGenCommit.UserData
get

Definition at line 155 of file SegmentsGenCommit.cs.

override long Lucene.Net.Index.SegmentsGenCommit.Version
get

Definition at line 147 of file SegmentsGenCommit.cs.


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