在 Drupal 6 中搜索联合/即时导入的内容
我面临的问题是,我正在动态地将新闻包含在 Drupal 6 内容页面中(将其视为 RSS 的某种专有形式),因此我的内容页面如下所示:
<?php
require_once('foo/news.php');
showNews(); // here we go
?>
在 showNews() 内,我检查 $_GET('新闻ID')
。如果未设置,我会显示新闻概述页面 - 各种新闻的标题,并通过适当的 ?newsID=123
参数链接到详细信息页面。如果是,我会显示该个别新闻条目。很复杂,但没有比这更深入或更复杂/嵌套的了。
一般来说,这就像一个魅力(也因为我有一个不错的专有缓存机制)。麻烦:现在我希望 Drupal6 搜索将这些新闻包含在搜索结果中。我到底该怎么做呢?
如前所述,它不是无底洞的:它有 1 个概述页面,大约 30 个“条目”,“每日”的最近性就足够了,所以如果我连接到 cron.php,每天擦除和重新索引一次,我会没事的。但我相当不知道从哪里开始向 drupal 搜索“提供”我的内容..
这是否可行。或者说,求助于谷歌自定义搜索是我唯一的选择吗? 是否有一些 Drupal 扩展可以通过前端进行搜索索引/蜘蛛抓取? (可以这么说,卷曲本身)。
谢谢大家ツ
I am facing the problem, that I have am including News in a Drupal 6 content page on the fly (think of it as some proprietary form of RSS), so my content page looks like this:
<?php
require_once('foo/news.php');
showNews(); // here we go
?>
Inside showNews() I check for $_GET('newsID')
. If not set, I show a news overview page -- the headlines of the varius news, linked to the detail pages with appropriate ?newsID=123
parameter. If it is, I show that individual news entry. Complicated, but it doesn't get any deeper or more complicated/nested than that.
And generally this works like a charm (also because I have a decent propriertary caching mechanisms). Trouble: Now I want Drupal6 search to include these news in search results. How the heck would I do that?
As said, it's not bottomless: It's 1 overview page, around 30 'entries', recentness of "daily" would suffice, so if I hooked in to cron.php, wiping and re-indexing once a day, I would be fine. But I am fairly clueless where to start to 'offer' my contents to drupal search..
Is this feasible. Or is, say, resorting to google custom search, my only option?
Is there maybe some Drupal Extension that does the search indexing/spidering through the frontend? (curling itself, so to speak).
Thank you, folks ツ
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为从中获取新闻的提要创建自定义 提要 解析器。您可以从中将新闻导入为节点并使用视图来搜索该内容。
要了解如何创建 Feed 解析器,您可以查看Feeds:YouTube 解析器模块。
You could create a custom Feeds parser for the feed from where you get the news. From that you could import the news as nodes and use a view to search that content.
To get a grip of how to create a feeds parser you could check out the Feeds: YouTube parser module.