Magento 1.12和Solr 3.6没有适当的结果,也没有拼写建议 [英] Magento 1.12 and Solr 3.6 No proper results and no spell suggestions

查看:59
本文介绍了Magento 1.12和Solr 3.6没有适当的结果,也没有拼写建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何想法或建议.我有点困惑,我已经设置了solr和magento两次,但是现在有了magento 1.12,它表现得奇怪,没有正确的结果,也没有拼写检查.

Any idea or suggestion. I am kind of confuse , I have setup solr and magento couple of times but now with magento 1.12 its behaving strange no proper results and no spell check.

我们让我们的magento 1.11在solr 1.4上正常工作,但仍然可以正常工作,我尝试使用1.4和solr 3.6没有修复.

We had our magento 1.11 working fine with solr 1.4 ,its still working fine I try to use 1.4 and solr 3.6 no fix.

任何想法或建议.我有点困惑

Any idea or suggestion. I am kind of confuse

推荐答案

我们发现Magento EE 1.12的solr有多个问题.

We have found multiple problems with solr with Magento EE 1.12.

  1. 如果通过cronjob从外壳程序运行全文本索引器,则以下事件(是,拼写不正确)将不会被分派"catelogsearch_searchable_attributes_load_after",并且该方法将不会运行:storeSearchableAttributes.这阻止了所有全文本属性在Solr文档中发送.解决方案是从GUI运行它,但您必须延长.htaccess中的php超时时间,并且可能还要延长php内存限制.我可能会在某个地方对其进行硬编码,因为您显然不希望网站访问者有那么长的超时时间.

  1. If you run the fulltext indexer from the shell via a cronjob the following event (yes it is spelled incorrectly) "catelogsearch_searchable_attributes_load_after" will not be dispatched and this method will not be run: storeSearchableAttributes. This prevented all the fulltext attributes from being sent in the Solr Documents. The solution is to run it from the GUI BUT you must extend your php timeout in .htaccess and probably extend php memory limit as well. I will probably hardcode it somewhere because you obviously don't want such a long timeout for your website visitors.

我建议在magento管理员gui中启用部分提交".

I recommend enabling "partial commit" in the magento admin gui.

在运行此索引器时,请注意solr日志.它提供了有价值的线索.我们遇到了两个导致solr严重错误的问题.一个错误地将"*"转义为"\ *"的位置. 我们通过在我们检查!=="*"的核心处创建局部替代来覆盖它: app/code/local/Enterprise/Search/Model/Adapter/Solr/Abstract.php

Pay attention to the solr log when you are running this indexer. It gives valuable clues. We had two issues which were causing severe errors in solr. One where a "*" was being escaped to "\*" incorrectly. We overrode it by creating a local override from core where we check !== "*": app/code/local/Enterprise/Search/Model/Adapter/Solr/Abstract.php

             foreach ($facetFieldConditions as $facetCondition) {
                 if (is_array($facetCondition) && isset($facetCondition['from'])
                         && isset($facetCondition['to'])) {
                    $from = (isset($facetCondition['from']) && strlen(trim($facetCondition['from'])) && trim($facetCondition['from']) !== "*")
                         ? $this->_prepareQueryText($facetCondition['from'])
                         : '*';
                    $to = (isset($facetCondition['to']) && strlen(trim($facetCondition['to'])) && trim($facetCondition['to']) !== "*")

  • 我们还遇到一种情况,即设置为multiselect的属性可能没有选择任何选项.长话短说,当数组为空时,会导致附加空字符串,从而引发错误.解决方法是先检查数组是否为空. 因此,我们必须使用app/code/local/Enterprise/Search/Model/Adapter/Abstract.php

  • We also had a case where an attribute that was set to multiselect could have no options chosen. Long story short when the array was empty it resulted in an empty string being appended which threw an error. The solution was to first check if the array was empty. So we had to override with app/code/local/Enterprise/Search/Model/Adapter/Abstract.php

    if (!empty($val)) { $preparedValue = array_merge($preparedValue, explode(',', $val)); }

    if (!empty($val)) { $preparedValue = array_merge($preparedValue, explode(',', $val)); }

    这篇关于Magento 1.12和Solr 3.6没有适当的结果,也没有拼写建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆