fix #1790 add reload doc index
This commit is contained in:
parent
919ca25ee0
commit
b1da0c7d3e
6 changed files with 57 additions and 0 deletions
|
@ -97,6 +97,31 @@ public class AdminMaintenanceAction extends FessAdminAction {
|
|||
return redirect(getClass());
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reloadDocIndex(final ActionForm form) {
|
||||
validate(form, messages -> {}, this::asIndexHtml);
|
||||
verifyToken(this::asIndexHtml);
|
||||
final String docIndex = fessConfig.getIndexDocumentUpdateIndex();
|
||||
fessEsClient
|
||||
.admin()
|
||||
.indices()
|
||||
.prepareClose(docIndex)
|
||||
.execute(
|
||||
ActionListener.wrap(
|
||||
res -> {
|
||||
logger.info("Close " + docIndex);
|
||||
fessEsClient
|
||||
.admin()
|
||||
.indices()
|
||||
.prepareOpen(docIndex)
|
||||
.execute(
|
||||
ActionListener.wrap(res2 -> logger.info("Open " + docIndex),
|
||||
e -> logger.warn("Failed to open " + docIndex, e)));
|
||||
}, e -> logger.warn("Failed to close " + docIndex, e)));
|
||||
saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
|
||||
return redirect(getClass());
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse clearCrawlerIndex(final ActionForm form) {
|
||||
validate(form, messages -> {}, this::asIndexHtml);
|
||||
|
|
|
@ -2889,6 +2889,12 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Download Logs */
|
||||
public static final String LABELS_download_diagnostic_logs_button = "{labels.download_diagnostic_logs_button}";
|
||||
|
||||
/** The key of the message: Reload Doc Index */
|
||||
public static final String LABELS_reload_doc_index = "{labels.reload_doc_index}";
|
||||
|
||||
/** The key of the message: Reload */
|
||||
public static final String LABELS_reload_doc_index_button = "{labels.reload_doc_index_button}";
|
||||
|
||||
/**
|
||||
* Assert the property is not null.
|
||||
* @param property The value of the property. (NotNull)
|
||||
|
|
|
@ -954,3 +954,5 @@ labels.clear_crawler_index=Crawler Indices
|
|||
labels.clear_crawler_index_button=Clear .crawler Indices
|
||||
labels.diagnostic_logs=Diagnostic
|
||||
labels.download_diagnostic_logs_button=Download Logs
|
||||
labels.reload_doc_index=Reload Doc Index
|
||||
labels.reload_doc_index_button=Reload
|
||||
|
|
|
@ -954,3 +954,5 @@ labels.clear_crawler_index=Crawler Indices
|
|||
labels.clear_crawler_index_button=Clear .crawler Indices
|
||||
labels.diagnostic_logs=Diagnostic
|
||||
labels.download_diagnostic_logs_button=Download Logs
|
||||
labels.reload_doc_index=Reload Doc Index
|
||||
labels.reload_doc_index_button=Reload
|
||||
|
|
|
@ -954,3 +954,5 @@ labels.clear_crawler_index=Crawlerインデックス
|
|||
labels.clear_crawler_index_button=.crawlerインデックスの削除
|
||||
labels.diagnostic_logs=診断
|
||||
labels.download_diagnostic_logs_button=ログのダウンロード
|
||||
labels.reload_doc_index=ドキュメントインデックスのリロード
|
||||
labels.reload_doc_index_button=リロード
|
||||
|
|
|
@ -93,6 +93,26 @@
|
|||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<la:message key="labels.reload_doc_index" />
|
||||
</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary"
|
||||
name="reloadDocIndex"
|
||||
value="<la:message key="labels.reload_doc_index_button"/>">
|
||||
<i class="fa fa-arrow-circle-right"></i>
|
||||
<la:message key="labels.reload_doc_index_button" />
|
||||
</button>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
|
|
Loading…
Add table
Reference in a new issue