这让我有点疯狂。我运行Magento 1.11.1和SOLR运行。我们有一个每天晚上运行的cron重新索引整个网站。每次这样做,我都会检查SOLR配置,而numDocs和maxDocs值只是当前索引的一小部分(27000比90000)。--这意味着当我在网站上搜索时,结果只是它们应有的一小部分。
使搜索正常工作的唯一方法是停止SOLR、删除和重新创建/apache-solr/site_name/solr/data文件夹、重新启动并通过shell重新索引Catalog搜索索引。如果我尝试通过shell运行这个特定的重新索引,而不删除和重新创建数据文件夹,那么我只能得到大约一半应该得到的文档(~51000)。
数据文件夹中的所有索引文件都属于root,SOLR jar作为root运行。我已经将所有日志设置为警告,但目前没有任何日志被记录。我使用Solr管理其他站点,从来没有这个问题-但是这个安装有许多属性(330)和许多产品(大约100,000)。这可能是问题的一部分吗?谢谢!
发布于 2012-10-04 14:30:23
EE1.12也可能不是一个解决方案。我们在EE1.12上有一个客户端,它与SOLR集成有问题。在这种情况下,当索引器访问自定义产品属性时,所有索引尝试都会失败。
this和Magento的支持已经在这方面工作了超过6个星期,Magento支持的现状是-
不幸的是,该补丁仍在开发中,我无法建议我们的开发人员何时完成它。
发布于 2013-03-15 09:21:58
由于Enterprise_Search模块添加了一个默认每天凌晨3时运行的cron作业,所以我找到了一个比向文件shell/abstract.php添加一行代码更好的解决方案。
您所需要做的就是创建一个小模块,该模块将某个事件添加到全局命名空间,而不是admin:
<?xml version="1.0"?>
<config>
<modules>
<YourNamespace_YourModuleName>
<version>0.0.1</version>
</YourNamespace_YourModuleName>
</modules>
<global>
<events>
<!-- The misspelling (cat-e-logsearch) is correct, you can look it up in the config.xml of the Enterprise_Search module -->
<catelogsearch_searchable_attributes_load_after>
<observers>
<enterprise_search>
<class>enterprise_search/observer</class>
<method>storeSearchableAttributes</method>
</enterprise_search>
</observers>
</catelogsearch_searchable_attributes_load_after>
</events>
</global>
</config>不要忘记通过在app/etc/modules/YourNamespace_YourModuleName.xml上放置另一个配置文件来激活模块
<?xml version="1.0"?>
<config>
<modules>
<YourNamespace_YourModuleName>
<active>true</active>
<codePool>local</codePool>
<depends>
<Enterprise_Search/>
</depends>
</YourNamespace_YourModuleName>
</modules>
</config>现在,您可以从命令行中通过从Magento根文件夹发出以下命令来重新构建Solr索引(当然,假设您拥有shell访问权限):
php shell/indexer.php --reindex catalogsearch_fulltext发布于 2013-01-21 08:17:40
在检查了几天后(顺便提一下这个问题),我想我有了一个解决方案。我对它进行了测试,没有看到任何bug出现。
# shell/abstract.php @ line 75
public function __construct()
{
if ($this->_includeMage) {
require_once $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'Mage.php';
Mage::app($this->_appCode, $this->_appType);
Mage::app()->addEventArea('adminhtml');# the magic line
}
$this->_applyPhpVariables();
$this->_parseArgs();
$this->_construct();
$this->_validate();
$this->_showHelp();
}问题是enterprise_search/observer没有加载,所以它可以触发storeSearchableAttributes方法。这导致各种额外的数据无法注册。
我能想到的唯一副作用是,现在shell 执行将加载所有管理观察者。这可能会导致速度的下降,从而挫败了从shell运行的部分目的。它不会像浏览器那样慢,但它可能会比以前慢。
如果你有任何问题或认为我可能在另一个方面的帮助,请告诉!
https://stackoverflow.com/questions/12624068
复制相似问题