Each Document in Solr must have an attribute that uniquely identifies itself. By default, the attribute name is id, which is described in the Schema configuration file using: <uniqueKey> id </uniqueKey>.
Install jdk and Tomcat 7
Apt-get install openjdk-7-jdk
Apt-get install tomcat7 tomcat7-admin
Download and configure apachesolr
Http://archive.apache.org/dist/lucene/solr/
Download an object in the following format:
Solr-4.x.x.tgz
Download solr and try to use the latest 4.x version. The structure of the 5.x directory has been greatly changed.
Tar xzf solr-4.x.x.tgz
Cd solr.4.x. x. tgz
Cp example/lib/ext/*/usr/share/tomcat7/lib/
Cp dist/solrj-lib/*/usr/share/tomcat7/lib/
Cp dist/solr-4.x.x.war/var/lib/tomcat7/webapps/solr. war
Mkdir-p/var/lib/tomcat7/solr
Cp-r example/solr/collection1/conf/var/lib/tomcat7/solr/
Solr configuration
Https://www.drupal.org/project/search_api_solr
Rsync-av search_api_solr/solr-conf/solr-4.x // var/lib/tomcat7/solr/conf/
Use the scheme.xmlconfiguration of http://pan.baidu.com/s/1gduye8fto overwrite the following file
/Var/lib/tomcat7/solr/drupal/conf/scheme. xml
Vi/var/lib/tomcat7/solr. xml
<? Xml version = "1.0" encoding = "UTF-8"?>
<Solr persistent = "false">
<Cores adminPath = "/admin/cores">
<Core name = "drupal" instanceDir = "drupal"/>
</Cores>
</Solr>
Mkdir/var/lib/tomcat7/solr/drupal
Cp-r/var/lib/tomcat7/solr/conf/var/lib/tomcat7/solr/drupal/
If two environments are required, run the following command:
Cp/var/lib/tomcat7/solr/drupal/var/lib/tomcat7/solr/dev-r
Vi/var/lib/tomcat7/solr. xml
<? Xml version = "1.0" encoding = "UTF-8"?>
<Solr persistent = "false">
<Cores adminPath = "/admin/cores">
<Core name = "dev" instanceDir = "dev"/>
<Core name = "drupal" instanceDir = "drupal"/>
</Cores>
</Solr>
Configure IK Chinese word segmentation
To begin.
Cp IKAnalyzer2012FF_u1.jar/var/lib/tomcat7/webapps/solr/WEB-INF/lib/
Cp stopword. dic IKAnalyzer. cfg. xml/var/lib/tomcat7/webapps/solr/WEB-INF/classes
Modify the file owner and restart the service.
Service tomcat7 stop
Chown tomcat7: tomcat7/var/lib/tomcat7-R
Service tomcat7 start