如何配置Magento Enterpise以使用Solr作为主要搜索引擎? [英] How to configure Magento Enterpise to use Solr as the main search engine?
问题描述
我尝试查找文档,但是它很少.我编写了以下指南,希望它可以为安装,设置和配置工作的人节省2-3个小时.
与MySQL全文搜索标准设置相比,使用Solr可获得的性能提升非常可观.绝对值得花时间在Magento安装中进行此操作.
I tried looking for documentation but it is quite sparse. I wrote the following guide hoping that it might save someone 2-3 hours dealing with installations, setup and configuration.
The performance gains from using Solr are quite spectacular compared to the MySQL fulltext search standard setup. It is definitely worth the time to get this working in your Magento installation.
推荐答案
Magento-Solr安装&配置
- 确保已安装Java JDK:
- Make sure the Java JDK is installed:
- sudo add-apt-repository ppa:sun-java-community-team/sun-java6
- sudo apt-get更新
- sudo apt-get install sun-java6-jre sun-java6-jdk
- sudo add-apt-repository ppa:sun-java-community-team/sun-java6
- sudo apt-get update
- sudo apt-get install sun-java6-jre sun-java6-jdk
安装和安装配置Tomcat:
Install & Configure Tomcat:
- 安装:
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user - 配置:
vi/etc/tomcat6/tomcat-users.xml -
将以下角色和用户添加到配置中.
- Installation:
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user - Configuration:
vi /etc/tomcat6/tomcat-users.xml Add the following roles and user to the configuration.
<role rolename="admin"/>
<role rolename="manager"/>
<user username="tomcat" password="password" roles="admin,manager"/>
重新启动服务器: /etc/init.d/tomcat6重新启动
Restart the server: /etc/init.d/tomcat6 restart
如果一切顺利,请转到 http://hostname:8080
If all goes well, goto http://hostname:8080
安装Solr:
- 在此处检查最新发行版.. http://apache.rediris.es/lucene/solr/
- 下载版本 http://apache.rediris.es/lucene/solr/3.3.0/apache-solr-3.3.0.zip
-
安装和安装配置
- Check for the latest distro here.. http://apache.rediris.es/lucene/solr/
- Download release http://apache.rediris.es/lucene/solr/3.3.0/apache-solr-3.3.0.zip
Install & Configure
- 解压缩apache-solr-3.3.0.zip
- mkdir/usr/share/tomcat6/webapps
- cp apache-solr-3.3.0/dist/apache-solr-3.3.0.war/usr/share/tomcat6/webapps/solr.war
- cp -r apache-solr-3.3.0/example/solr/usr/share/tomcat6/solr
-
vi/etc/tomcat6/Catalina/localhost/solr.xml
- unzip apache-solr-3.3.0.zip
- mkdir /usr/share/tomcat6/webapps
- cp apache-solr-3.3.0/dist/apache-solr-3.3.0.war /usr/share/tomcat6/webapps/solr.war
- cp -r apache-solr-3.3.0/example/solr /usr/share/tomcat6/solr
vi /etc/tomcat6/Catalina/localhost/solr.xml
<Context docBase="/usr/share/tomcat6/webapps/solr.war" debug="0"
privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String"
value="/usr/share/tomcat6/solr" override="true" />
</Context>
您应该在Tomcat admin/manager页面上看到Solr访问( http://hostname:8080 /manager/html )
配置Magento以使用Solr:
Configure Magento to use Solr:
-
用Magento conf文件替换原始的Solr conf目录.诀窍只是从Magento复制目录,然后在Solr中替换目录.而已!
Replace the original Solr conf directory with the Magento conf files. The trick is just to copy the directory from Magento, and replace the one in Solr. That's it!
- 在Magento中,该文件夹位于:[magento-instance-root]/lib/Apache/Solr/conf.
- 在Solr中,该文件夹位于[Solr-instance-root]/example/solr/conf中.
- In Magento, the folder is located in: [magento-instance-root]/lib/Apache/Solr/conf.
- In Solr, the folder is located in [Solr-instance-root]/example/solr/conf.
故障排除:
确保所有配置文件都属于tomcat6:tomcat6
chown -r tomcat6.tomcat6 ...
Make sure all configuration files belong to tomcat6:tomcat6
chown -r tomcat6.tomcat6 ...
- /var/lib/tomcat6/conf/Catalina/localhost
- /usr/share/tomcat6/solr/conf
这篇关于如何配置Magento Enterpise以使用Solr作为主要搜索引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!