fix #399 : call flush of elasticsearch
This commit is contained in:
parent
8085e1752d
commit
63057b9a10
1 changed files with 5 additions and 0 deletions
|
@ -444,6 +444,11 @@ public class FessEsClient implements Client {
|
|||
@Override
|
||||
@PreDestroy
|
||||
public void close() {
|
||||
try {
|
||||
client.admin().indices().prepareFlush().setForce(true).execute().actionGet();
|
||||
} catch (Exception e) {
|
||||
logger.warn("Failed to flush indices.", e);
|
||||
}
|
||||
try {
|
||||
client.close();
|
||||
} catch (final ElasticsearchException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue