安装单机版Solr服务
1、拉取 Solr 镜像;
docker pull solr:7.4.0
2、启动 Solr 容器,即可访问 http://ip:8983/ ;
docker run --name taotao-solr -d -p 8983:8983 -t solr:7.4.0
3、新建 SolrCore,名称为 collection1;
docker exec -it --user=solr taotao-solr bin/solr create_core -c collection1
4、为了方便后续修改配置,将容器 solr 文件拷贝本地 /usr/local/solr/ 路径下;
docker cp taotao-solr:/opt/solr/ /usr/local/ # 容器拷贝宿主机
5、设置中文分词 smartcn;
5.1 进入容器
docker exec -it taotao-solr /bin/bash
5.2 定位Solr7自带的中文分词器 smartcn 的jar包位置 /opt/solr/contrib/analysis-extras/lucene-libs;
5.3 进入创建的 solrcore: collection1 配置目录 /opt/solr/server/solr/collection1/conf ,修改 solrconfig.xml 添加 smartcn 包的 lib 标签;
solrconfig.xml <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
添加
<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" regex="lucene-analyzers-smartcn-7.4.0.jar" />添加
相关推荐
wsxsxz 2020-01-09
spylyt 2020-09-11
upxiaofeng 2020-06-11
TyCoding 2020-05-03
upxiaofeng 2020-04-30
lionelf 2020-04-20
TyCoding 2020-04-08
TyCoding 2020-03-26
wenchanter 2020-03-26
roygbip 2020-02-16
wsxsxz 2020-02-03
lionelf 2020-02-03
lionelf 2020-02-03
TyCoding 2020-02-01
heniancheng 2020-01-31
lionelf 2020-01-30
TyCoding 2020-01-10