Browse Source

REPORT-9446

【10.0一轮回归】alphafine搜不出本地常用了
master
XiaXiang 6 years ago
parent
commit
445b39af9e
  1. 5
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

5
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -14,6 +14,7 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.third.org.apache.lucene.analysis.Analyzer; import com.fr.third.org.apache.lucene.analysis.Analyzer;
import com.fr.third.org.apache.lucene.analysis.standard.StandardAnalyzer; import com.fr.third.org.apache.lucene.analysis.standard.StandardAnalyzer;
import com.fr.third.org.apache.lucene.document.Document; import com.fr.third.org.apache.lucene.document.Document;
@ -115,7 +116,9 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
private void initReader() { private void initReader() {
if (indexReader == null) { if (indexReader == null) {
try { try {
directory = FSDirectory.open(new File(path)); File file = new File(path);
StableUtils.mkdirs(file);
directory = FSDirectory.open(file);
indexReader = DirectoryReader.open(directory); indexReader = DirectoryReader.open(directory);
} catch (IOException e) { } catch (IOException e) {
FineLoggerFactory.getLogger().error("not privilege to read " + path); FineLoggerFactory.getLogger().error("not privilege to read " + path);

Loading…
Cancel
Save