Solr Bridge Search Installation Guide
Table of contents
1. Solr Installation
1.1 Tomcat6 (Web server) installation. 1.2 Apache Solr 3.3.0 installation.
1.3 Install SolrBirge package (preconfigured solr instance). 1.4 Make a new context for Solr in Tomcat6
1.5 Database configuration 1.6 Test Solr Bridge installation. 2. Magento extension installation
2.1 Extract and install 2.2 Configuration
3. Run data indexing and enjoy the search
1. Solr Installation
1.1 Tomcat6 (Web server) installation.
Run the following command to install Apache Tomcat6 if your server does not exist Tomcat6 yet. sudo apt-get install tomcat6
1.2 Apache Solr 3.3.0 installation.
-Go to /usr/local directory by the command: cd /usr/local-Download Solr 3.3.0 by the command:
wget http://www.apache.org/dist/lucene/solr/3.3.0/apache-solr-3.3.0.tgz
-Extract the apache-solr-3.3.0.tgz file by the command: tar xvzf apache-solr-3.3.0.tgz
-Change to the sub directory apache-solr-3.3.0/dist by: cd apache-solr-3.3.0/dist
-Copy file apache-solr-3.3.0/dist/apache-solr-3.3.0.war into tomcat webapps by the command:
cp apache-solr-3.3.0/dist/apache-solr-3.3.0.war /var/lib/tomcat6/webapps/ solr.war
-Restart tomcat6 by the command
/etc/init.d/tomcat6 restart -Test solr installation
Open browser and try to access the url in the following format: http://<yourdomain or your ip address>:<port>/solr
Example: http://localhost:8080/solr
1.3 Install SolrBirge package (preconfigured solr instance).
-Get inside the folder apache-solr-3.3.0 by the command:cd /usr/local/apache-solr-3.3.0
-Put the solrbridge.tar.gz (the file attached in email) in /usr/local/apache-solr-3.3.0. In my case, i download the file from other pc by the following command wget http://192.168.2.148/solrbridge.tar.gz -Extract the file solrbridge.tar.gz by the command:
tar xvzf solrbridge.tar.gz
1.4 Make a new context for Solr in Tomcat6
-Create a new file named solr.xml under /var/lib/tomcat6/conf/Catalina/localhost by the following command: vi /var/lib/tomcat6/conf/Catalina/localhost/solr.xml
-And put the following xml code into the file
<Context docBase="/var/lib/tomcat6/webapps/solr.war" debug="0" priviledged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/local/ apache-solr-3.3.0/solrbridge" override="true" />
</Context> -Restart tomcat 6
1.5 Database configuration
-Open /usr/local/apache-solr-3.3.0/solrbridge/solr.xml and change database information according to your own as below:
<solr persistent="false">
<property name="databaseUrl" value="jdbc:mysql://<databasehost>/<database name>" />
<property name="databaseUser" value="<database user>" />
<property name="databasePassword" value="<database password>" />
-Restart tomcat 6
1.6 Test Solr Bridge installation.
Open browser and try to access the url in the following format: http://<yourdomain or your ip address>:<port>/solr
Example: http://localhost:8080/solr
2. Magento extension installation
2.1 Extract and install
- Extract the file Magento_Solr_Bridge_1.7.tar.gz
- After you extract the file, you will have 3 directory app, js, lib - Copy these 3 folders and paste them to your magento root Example:
magento application is stored at: /var/www/magento Then /var/www/magento is the magento root
-Set the Main index for main website (Click Main website on the left side bar, then select Main
index from the dropdown list, and Save configuration)
3. Run data indexing and enjoy the search
Example: http://localhost:8080/solr/main/dataimport?command=full-import Result as below:
-Run the URL as the following format to see status of indexing process: http://<solr url>:<port>/solr/<core>/dataimport?command=stats
4. Customization
By defautl, Magento Solr Bridge works for the default template, so if you created and run Magento with a custom template please do the following:
1. Copy app\design\frontend\default\default\layout\solrsearch.xml to app\design\frontend\default\YOUR TEMPLATE\layout\
2. Copy app\design\frontend\default\default\template\solrsearch to app\design\frontend\default\YOUR TEMPLATE\template\solrsearch
[END]
If you have any problem during the installtion process or find any bug inside the extension please contact me:
Hau Danh
Email: [email protected]