analysis-ik icon indicating copy to clipboard operation
analysis-ik copied to clipboard

mac下没有config配置文件夹的问题, 无法自定义词典

Open bode135 opened this issue 3 years ago • 3 comments

使用./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.3.0/elasticsearch-analysis-ik-6.3.0.zip安装的7.10.2版本

安装后plugins目录结构如下:

  • ls命令 image
  • tree命令 image

我想自定义词典, 但我找不到Readme里面说的"conf"文件夹.

Dictionary Configuration
IKAnalyzer.cfg.xml can be located at {conf}/analysis-ik/config/IKAnalyzer.cfg.xml or {plugins}/elasticsearch-analysis-ik-*/config/IKAnalyzer.cfg.xml

我尝试了手动下载然后解压, 但elasticsearch-plugin list报错了.

warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
.DS_Store
Exception in thread "main" java.nio.file.FileSystemException: /usr/local/Cellar/elasticsearch/7.10.2/libexec/plugins/.DS_Store/plugin-descriptor.properties: Not a directory
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:375)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:426)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:156)
	at org.elasticsearch.plugins.ListPluginsCommand.printPlugin(ListPluginsCommand.java:66)
	at org.elasticsearch.plugins.ListPluginsCommand.execute(ListPluginsCommand.java:60)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
	at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:91)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47)

尝试重启然后连接http://localhost:9200/也无法打开.
请问如何解决呢?

bode135 avatar Apr 29 '21 09:04 bode135

重启es能成功, 就是打不开9200端口.

brew services start elasticsearch
brew services restart elasticsearch

image

image

bode135 avatar Apr 29 '21 09:04 bode135

已解决, mac下用brew安装的话, 路径跟linux&windows不同.
用tree命令看一下文件结构就能找到config了

bode135 avatar May 02 '21 09:05 bode135

不知道什么原因,配置文件改放到了 /usr/share/elasticsearch/config/analysis-ik/ 下。浪费了很多时间才找到,被恶心到了

cloudylong avatar Mar 27 '22 10:03 cloudylong