The IK Analysis plugin integrates Lucene IK analyzer into OpenSearch, support customized dictionary. Port of https://github.com/medcl/elasticsearch-analysis-ik
Apache License 2.0
41
stars
15
forks
source link
Config & dict path incorrect and version unspecified in version 2.11.0 with Docker #31
mkdir ik-tmp && cd ik-tmp
wget https://github.com/aparo/opensearch-analysis-ik/releases/download/2.11.0/opensearch-analysis-ik.zip
Create Dockerfile.
FROM opensearchproject/opensearch:2.11.0
COPY ./opensearch-analysis-ik.zip /tmp/
RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-analysis-ik.zip
- Build image and start container for testing.
```bash
docker build -t opensearch-with-ik:2.11.0 .
docker run --name opensearch-with-ik-test --rm -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearch-with-ik:2.11.0
When I start container for testing, following error appears:
/usr/share/opensearch/config/analysis-ik/IKAnalyzer.cfg.xml (No such file or directory)
/usr/share/opensearch/plugins/opensearch-analysis-ik/config/main.dic (No such file or directory)
I connect to the container check the real path that contains configuration and dictionary files is /usr/share/opensearch/config/opensearch-analysis-ik
This is how I fix it by making a symbol link redirect the real path to desired path.
FROM opensearchproject/opensearch:2.11.0
COPY ./opensearch-analysis-ik.zip /tmp/
RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-analysis-ik.zip
Make a symbol link to fix the path issue
RUN ln -s /usr/share/opensearch/config/opensearch-analysis-ik /usr/share/opensearch/plugins/opensearch-analysis-ik/config
- Rebuild and start container the errors are gone. I can see the IK plugin is loaded, but version is unspecified still.
```bash
curl -X GET https://localhost:9200/_cat/plugins?v -ku "admin:admin"
name component version
df8dea9d22fc opensearch-analysis-ik unspecified
Have no idea if there're bugs or anything I missed. Please kindly guide, thanks!
I tried to install this plugin using Docker per document https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/
Download the zip file.
Create Dockerfile.
COPY ./opensearch-analysis-ik.zip /tmp/ RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-analysis-ik.zip
When I start container for testing, following error appears:
I connect to the container check the real path that contains configuration and dictionary files is
/usr/share/opensearch/config/opensearch-analysis-ik
This is how I fix it by making a symbol link redirect the real path to desired path.
COPY ./opensearch-analysis-ik.zip /tmp/ RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-analysis-ik.zip
Make a symbol link to fix the path issue
RUN ln -s /usr/share/opensearch/config/opensearch-analysis-ik /usr/share/opensearch/plugins/opensearch-analysis-ik/config
Have no idea if there're bugs or anything I missed. Please kindly guide, thanks!