Attempting to use the merge policy "UpgradeIndexMergePolicy" via the
"UpgradeIndexMergePolicyFactory" seems to result in no merging.
Here is my config fragment:
<mergePolicyFactory
class="org.apache.solr.index.UpgradeIndexMergePolicyFactory">
<str name="wrapped.prefix">mergePolicy</str>
<str
name="mergePolicy.class">org.apache.solr.index.TieredMergePolicyFactory</str>
<int name="mergePolicy.maxMergeAtOnce">2</int>
<int name="mergePolicy.segmentsPerTier">2</int>
<double name="mergePolicy.noCFSRatio">0.0</double>
</mergePolicyFactory>
The description of the policy says:
> This MergePolicy is used for upgrading all existing segments of an
index when calling IndexWriter.forceMerge(int).
> All other methods delegate to the base MergePolicy given to the
constructor. This allows for an as-cheap-as possible
> upgrade of an older index by only upgrading segments that are created
by previous Lucene versions.
> forceMerge does no longer really merge; it is just used to
"forceMerge" older segment versions away.
Based on this description, when I run "forceMerge" via the curl command:
http://solr-0001:8983/solr/collection/update?optimize=true&maxSegments=1
The non-current version segments should get rewritten to new replacement
segments using the current Lucene version without reindexing being needed.
The documentation does not provide an example of how to actually use
this policy in a collection's config file. My fragment is a best guess
based on Google search results.
Links:
https://lucene.apache.org/core/7_7_3/core/org/apache/lucene/index/UpgradeIndexMergePolicy.html?is-external=true
https://solr.apache.org/docs/7_7_3/solr-core/org/apache/solr/index/UpgradeIndexMergePolicyFactory.html
Help would be appreciated.
-Michael/NewSRX Tech