如何配置 Magento Enterprise 以使用 Solr 作为主要搜索引擎? [英] How to configure Magento Enterpise to use Solr as the main search engine?
问题描述
我试图寻找文档,但它非常稀疏.我编写了以下指南,希望它可以为某人节省 2-3 小时的安装、设置和配置时间.
与 MySQL 全文搜索标准设置相比,使用 Solr 的性能提升非常惊人.绝对值得花时间在您的 Magento 安装中使用它.
Magento - Solr 安装 &配置
- 确保安装了 Java JDK:
- sudo add-apt-repository ppa:sun-java-community-team/sun-java6
- sudo apt-get 更新
- sudo apt-get install sun-java6-jre sun-java6-jdk
安装 &配置Tomcat:
- 安装:
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user - 配置:
vi/etc/tomcat6/tomcat-users.xml 将以下角色和用户添加到配置中.
<role rolename="manager"/><user username="tomcat" password="password" roles="admin,manager"/> 重启服务器:/etc/init.d/tomcat6 重启
如果一切顺利,转到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
安装 &配置
- 解压 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
<前><环境名称="solr/home" type="java.lang.String"value="/usr/share/tomcat6/solr" override="true"/>上下文> - chown -r tomcat6.tomcat6/var/lib/tomcat6
- /etc/init.d/tomcat6 restart
您应该会在 Tomcat 管理员/管理器页面上看到 Solr 访问权限 (http://hostname:8080/manager/html)
配置 Magento 以使用 Solr:
用 Magento conf 文件替换原来的 Solr conf 目录.诀窍是从 Magento 复制目录,并替换 Solr 中的目录.而已!
- 在 Magento 中,该文件夹位于:[magento-instance-root]/lib/Apache/Solr/conf.
- 在 Solr 中,该文件夹位于 [Solr-instance-root]/example/solr/conf.
- 在 Magento 中配置 Solr:在管理员中,转到系统 -> 配置 -> 目录 -> 目录搜索
<小时>
疑难解答:
确保所有配置文件都属于 tomcat6:tomcat6
chown -r tomcat6.tomcat6 ...
- /var/lib/tomcat6/conf/Catalina/localhost
- /usr/share/tomcat6/solr/conf
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 Installation & Configuration
- Make sure the Java JDK is installed:
- 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
Install & Configure Tomcat:
- 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"/>
Restart the server: /etc/init.d/tomcat6 restart
If all goes well, goto http://hostname:8080
- Installation:
Install Solr:
- 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
- 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>
- chown -r tomcat6.tomcat6 /var/lib/tomcat6
- /etc/init.d/tomcat6 restart
You should see Solr access on your Tomcat admin/manager page (http://hostname:8080/manager/html)
Configure Magento to use 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!
- 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.
- Configure Solr in Magento: In admin, goto System -> Configuration -> Catalog -> Catalog Search
Troubleshooting:
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 Enterprise 以使用 Solr 作为主要搜索引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!