Expert: a MergePolicy determines the sequence of
primitive merge operations to be used for overall merge
and optimize operations.Whenever the segments in an index have been altered by
{@link IndexWriter}, either the addition of a newly
flushed segment, addition of many segments from
addIndexes* calls, or a previous merge that may now need
to cascade, {@link IndexWriter} invokes {@link
#findMerges} to give the MergePolicy a chance to pick
merges that are now required. This method returns a
{@link MergeSpecification} instance describing the set of
merges that should be done, or null if no merges are
necessary. When IndexWriter.optimize is called, it calls
{@link #findMergesForOptimize} and the MergePolicy should
then return the necessary merges.Note that the policy can return more than one merge at
a time. In this case, if the writer is using {@link
SerialMergeScheduler}, the merges will be run
sequentially but if it is using {@link
ConcurrentMergeScheduler} they will be run concurrently.The default MergePolicy is {@link
LogByteSizeMergePolicy}.NOTE: This API is new and still experimental
(subject to change suddenly in the next release)NOTE: This class typically requires access to
package-private APIs (e.g.
CopyC#) to do its job;
if you implement your own MergePolicy, you'll need to put
it in package Lucene.Net.Index in order to use
these APIs.

SegmentInfos
The MergePolicy..::..MergeException type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | MergePolicy..::..MergeException(Exception) | Obsolete. Initializes a new instance of the MergePolicy..::..MergeException class |
![]() | MergePolicy..::..MergeException(String) | Obsolete. Initializes a new instance of the MergePolicy..::..MergeException class |
![]() | MergePolicy..::..MergeException(Exception, Directory) | Initializes a new instance of the MergePolicy..::..MergeException class |
![]() | MergePolicy..::..MergeException(String, Directory) | Initializes a new instance of the MergePolicy..::..MergeException class |
Methods
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.) |
![]() | GetDirectory | Returns the {@link Directory} of the index that hit
the exception.
|
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.) |
![]() | GetType | Gets the runtime type of the current instance. (Inherited from Exception.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.) |
Properties
Name | Description | |
---|---|---|
![]() | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.) |
![]() | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.) |
![]() | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.) |
![]() | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.) |
![]() | Message | Gets a message that describes the current exception. (Inherited from Exception.) |
![]() | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.) |
![]() | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.) |
![]() | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.) |
Events
Name | Description | |
---|---|---|
![]() | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from Exception.) |