Browse Source

fix compiler error under elasticsearch 7.15.2

master
Indexea 2 years ago
parent
commit
eceb440f48
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      elasticsearch/src/main/java/com/indexea/ideaseg/elasticsearch/IdeasegPlugin.java

+ 1
- 2
elasticsearch/src/main/java/com/indexea/ideaseg/elasticsearch/IdeasegPlugin.java View File

@@ -4,7 +4,6 @@ import com.hankcs.hanlp.utility.Predefine;
import com.indexea.ideaseg.core.IdeasegIOAdapter;
import com.indexea.ideaseg.core.PluginBase;
import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.common.io.PathUtils;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.analysis.AnalyzerProvider;
@@ -35,7 +34,7 @@ public class IdeasegPlugin extends Plugin implements AnalysisPlugin, PluginBase
home = Environment.PATH_HOME_SETTING.get(settings);
if (home == null)
throw new IllegalStateException(Environment.PATH_HOME_SETTING.getKey() + " is not configured");
Path pluginHome = PathUtils.get(home, "plugins", PLUGIN_NAME);
Path pluginHome = java.nio.file.FileSystems.getDefault().getPath(home, "plugins", PLUGIN_NAME);
IdeasegIOAdapter.BASE_PATH = pluginHome.toString() + File.separator; //设置 HanLP 根目录
Predefine.HANLP_PROPERTIES_PATH = IdeasegIOAdapter.BASE_PATH + CONFIG_FILE_NAME;
}


Loading…
Cancel
Save