1、创建core文件夹
ck /usr/local/solr-7.7.2/server/solr mkdir first-core cp -r configsets/_default/* first_core/
2、添加core
3、配置中文IK分词器
参考:https://github.com/magese/ik-analyzer-solr
1)将ik-analyzer-7.7.1.jar复制到
2)将https://github.com/magese/ik-analyzer-solr/tree/v7.7.1/src/main/resources目录下的dynamicdic.txt、ext.dic、ik.conf、IKAnalyzer.cfg.xml、stopword.dic文件复制到solr-7.7.2/server/solr-webapp/webapp/WEB-INF/classes目录下。
3)修改managed-schema,添加配置:
<!-- ik分词器 --> <fieldType name="text_ik" class="solr.TextField"> <analyzer type="index"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" conf="ik.conf"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" conf="ik.conf"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
4)重启solr服务
5)测试IK分词器