首先,我在SO中发现了类似的问题,但没有任何答案.所以,问题的第一部分有点重复.我想改进Magento的搜索结果.这是我已经做过的事情:
1.搜索AND而不是OR当有多个单词时.
2. Ajax搜索从任何地方开始搜索,而不仅仅是从字段的开头搜索.
3.修剪s单词中的最后一个以防止在使用复数形式搜索时出现空结果.
4.我将搜索类型更改Like为Fulltext或者Combine但结果不是更好,甚至是最差的,所以我保持原样.它Like现在,所以没有relevance订购.
我想要尝试的最后一件事是将其添加到搜索查询中:
SELECT ... other non-full-text-cols
MATCH (product_title) AGAINST ('lean body for her') AS rel1,
MATCH (content) AGAINST ('lean body for her') AS rel2
FROM table
WHERE MATCH (product_title,content) AGAINST ('lean body for her')
ORDER BY (rel1*1.5)+(rel2)
Run Code Online (Sandbox Code Playgroud)
这是我的查询,但我不确定它是否可行,因为我无法测试它:
$this->_productCollection->addAttributeToSelect(
array(
'rel1' => new Zend_Db_Expr('MATCH (name) AGAINST ("'.$queryText.'")'),
'rel2' => new Zend_Db_Expr('MATCH (short_description) AGAINST ("'.$queryText.'")') …Run Code Online (Sandbox Code Playgroud) collections magento e-commerce entity-attribute-value magento-1.6
我写了一个自定义404 Page Not Found页面.但是我必须把它放在我的Zend应用程序结构中以及如何显示它?
当找不到控制器时,我收到Invalid controller specified (dsa)错误.当无法找到某个动作时,我收到Action "wqe" does not exist and was not trapped in __call()错误消息.
不久,我不想要这些错误.
如何在渲染之前检测页面是否未找到?当我检测到它时,如何显示我的自定义错误页面.目前我从上面收到错误,但仍然显示布局.
我需要一些.htaccess规则吗?或者它可以用一些Zend的东西来完成.
以下是我如何将Facebook Feed Dialog实现到我的页面:
HTML标记:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://opengraphprotocol.org/schema/">
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=***************";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
FB.init({
appId: '***************',
display: 'popup',
status: true,
cookie: true,
xfbml: true,
oauth: true,
method: 'send'
});
Run Code Online (Sandbox Code Playgroud)
发送按钮:
<a onclick="javascript:twitter(this); return false;" href="https://www.facebook.com/dialog/feed?display=popup&app_id=***************&name=<name>&link=<link>&redirect_uri=<uri>">
<div class="fb-container"></div>
</a>
Run Code Online (Sandbox Code Playgroud)
在这里我使用Twitter的弹出脚本因为display:popup不起作用,不知道为什么.
然而,弹出窗口出现,我发送了Feed.但后来我被重定向到redirect_uri.我不想要这个.我只想在单击"发送"或"取消"按钮后关闭弹出窗口.我做了类似于检测按钮是否被点击然后尝试window.close;但没有成功的事情,因为它是一个新窗口(弹出窗口).
有任何想法吗?