之前的本地常用功能,没有考虑到重启场景,需要判空后再处理。
@ -113,7 +113,10 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
*/
private void initReader() {
try {
if(indexWriter != null){
indexWriter.close();
}
directory = FSDirectory.open(new File(path));
indexReader = DirectoryReader.open(directory);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);