我工作的公司继承了一个 Joomla 网站,我没有使用 Joomla 的经验,所以我希望有人可以让我知道以下是否可能。
在 Joomla 网站上搜索时,客户希望某些搜索词的某些页面出现在搜索结果的顶部。
是否可以根据搜索词将某些页面提升到搜索结果的顶部?
感谢对此的任何支持。
更新
在本地测试我已经更新了 /plugins/search/content.php 中的 SQL 查询,以接近我所追求的结果。
SELECT
a.title AS title,
a.metadesc,
a.metakey,
a.created AS created,
CONCAT(a.introtext, a.fulltext) AS text,
CONCAT_WS( "/", u.title, b.title ) AS section,
CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,
CASE WHEN CHAR_LENGTH(b.alias) THEN CONCAT_WS(":", b.id, b.alias) ELSE b.id END as catslug, u.id AS sectionid, "2" AS browsernav
FROM jos_content AS a
INNER JOIN jos_categories AS b ON b.id=a.catid
INNER JOIN jos_sections AS u ON u.id = a.sectionid
WHERE
((a.title LIKE '%carbohydrate%' OR a.introtext LIKE '%carbohydrate%' OR a.fulltext LIKE '%carbohydrate%' OR a.metakey LIKE '%carbohydrate%' OR a.metadesc LIKE '%carbohydrate%'))
AND a.state = 1
AND u.published = 1
AND b.published = 1
AND a.access <= 0
AND b.access <= 0
AND u.access <= 0
AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2013-02-18 14:55:51' )
AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2013-02-18 14:55:51' )
GROUP BY a.id
ORDER BY
(NOT(a.title LIKE '%carbohydrate%'))
, (NOT(a.introtext LIKE '%carbohydrate%'))
, (NOT(a.fulltext LIKE '%carbohydrate%'))
, (NOT(a.metakey LIKE '%carbohydrate%'))
, (NOT(a.metadesc LIKE '%carbohydrate%'))
我现在想把它作为一个自定义插件,而不是覆盖任何核心插件。我已按照http://docs.joomla.org/Creating_a_search_plugin上的教程进行操作,但是如何将站点设置为使用自定义插件而不是默认搜索插件?