[
https://issues.apache.org/jira/browse/LUCENE-5526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14096888#comment-14096888
]
Shai Erera commented on LUCENE-5526:
------------------------------------
On LUCENE-5883 I moved MergePolicy to LiveIndexWriterConfig. This means that
applications can now do this (to address this issue):
{code}
writer.getConfig().setMergePolicy(upgradeIndexMP);
writer.forceMerge(1);
writer.getConfig().setMergePolicy(origMP);
{code}
I think that's acceptable and adding another API to IW is not needed. This is
anyway not something that apps do on an hourly basis ...
> Forced merges
> -------------
>
> Key: LUCENE-5526
> URL: https://issues.apache.org/jira/browse/LUCENE-5526
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Priority: Minor
>
> {{IndexWriter.forceMerge}} allows to force merges if the number of segments
> is higher than a configured limit. I would like to have the ability to also
> force a merge if there is a single segment in the directory. This is possible
> today by closing the IndexWriter, reopening with a custom merge policy such
> as {{UpgradeIndexMergePolicy}}, running a {{forceMerge}} and finally
> reopening again with the original merge policy but this is a bit impractical
> and if possible I would like to be able to do it without reopening the writer
> twice.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]