First, download and install Apache Solr 8.2.0
Download: http://lucene.apache.org/solr/downloads.html
Because it is deployed on the deployment of the windows system, so you can download the zip archive.
After downloading extract it.
Second, start solr service
into the solr-7.3.0 / bin directory:
Shift + right to open a command window here;
In the console, enter the following command:
solr start -p 9090
See Started Solr server on port 9090. Happy searching! Represents solr service has started successfully, here it is solr own jetty started.
Then we can open a browser to access: http: // localhost: 9090 / solr / index.html
We can see solr has been successfully launched.
Third, add solr core
to enter solr-7.3.0 / example / example- DIH / solr / solr directory
conf file in that directory folder and file copy core.properties
Next we enter solr-7.3.0 / server / solr directory
In this directory create a folder mycore
Then we will be above core.properties conf folder and copy files to this folder
Then in cmd window before the start of solr restart the service, enter the following command in the console:
solr restart -p 9090
Upon completion of the restart refresh http: // localhost: 9090 / solr / index.html page,
Solr core has been added successfully found a
Fourth, the Chinese word configuration is IK-Analyzer-Solr8
be downloaded ik solr8 version of the word, download address: https://search.maven.org/search?q=com.github.magese
tokenizer GitHub source address: https: //github.com/magese/ik-analyzer-solr8
Partakers of the word's use on GitHub
Will be downloaded into the jar package solr-7.3.0 / server / solr-webapp / webapp / WEB-INF / lib directory
Then open the managed-schema file to solr-7.3.0 / server / solr / mycore / conf directory
Add the following code in the configuration file:
<!-- 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>
Solr service restart once again the configuration is complete
solr restart -p 9090
Refresh again http: // localhost: 9090 / solr / index.html page
Select mycore -> Analysis -> select the input word is text_ik "night gave me a black eye."
Click "Analyse Values" button to see the results of segmentation has been a success.