Drupal 搜索引擎不索引我的自定义节点! [英] Drupal search engine does not index my custom nodes!

查看:41
本文介绍了Drupal 搜索引擎不索引我的自定义节点!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约一个小时前有人发布了一个关于 drupal 搜索引擎的问题,大概是这样的:

Somebody has posted an hour ago or so a question that was about the drupal search engine and was about like this:

我知道 drupal 应该索引 node_view() 返回的任何内容,但这不会发生在我的自定义内容中.另外:有没有比 Drupal 内置功能更好的替代品?

I know drupal should index anything that is returned by node_view() but this is not happening for my custom content. Also: are there better alternatives to Drupal built-in functionality?

因为在我回答时问题已被删除,并且不想白白浪费我生命中的 20 分钟 ;) 我想第二次重新创建这个问题.希望按照 SO 的规则,这没问题!:)

As the question has been removed while I was answering, and didn't want to throw away 20 minutes of my life for nothing ;) I thought to re-create the question a second time. Hope this is fine by the rules of SO! :)

推荐答案

Drupal 搜索引擎可能不是 Drupal 最著名的功能,但相当可靠、复杂和可靠.有很多模块可以增强或替代它,但是- 至少根据我的经验 - 没有一种普遍接受的更好的方法"来管理搜索和索引.

The Drupal search engine is probably not the most celebrated feature of Drupal, but is fairly solid, sophisticated and reliable. There are plenty of modules that enhance or substitute it but - at least in my experience - there is not a commonly accepted "better way" to manage searching and indexing.

然而,对于非常大和繁忙的网站,人们更喜欢完全使用外部工具,如谷歌搜索框,甚至专用软件或硬件,如 solr/lucene 或谷歌搜索设备 (GSA).

However, for very big and busy sites people prefer to use external tools altogether, like a google searchbox or even dedicated software or hardware, like solr / lucene or google search appliance (GSA).

我在上面提供的链接 - 然而 - 按降序使用统计对搜索相关模块进行排序,因此您会在第一页上找到最常用的模块.我个人喜欢英语网站的一个是 porter-stemmer,它通过词干(例如: highness、higher 和higher 都将作为单词high"的匹配项返回).

The link I provided above - however - sorts the search-related modules by descending usage statistics, so you will find on the first page the one most commonly used. One that I personally like for English language sites is the porter-stemmer, which index words by their stem (eg: highness, highest and higher will all be returned as matches for the word "high").

那是关于搜索和 Drupal 的一般信息.至于您的问题,您可以检查许多事项以追踪您的问题:

That was for the general information on search and Drupal. As for your problem, there are a number of things you could check to track down your problem:

  1. 您的 cron.php 最近执行了吗? 索引是作为 cron 运行的一部分完成的,所以 - 如果您没有设置 crontab 或如果您还没有手动执行它,您的节点可能还没有被索引.

  1. Have your cron.php been executed lately? Indexing is done as part of the cron run, so - if you do not have a crontab set or if you haven't executed it by hand, your node will likely not been indexed yet.

设置是否正确?搜索模块的设置位于http://example.com/admin/settings/search :您的最小字长是否足以满足您的需要(默认为 3 个字母)?

Are the settings correct? Settings for the search module are located at http://example.com/admin/settings/search : is your minimum word length sufficient for your needs (the default is 3 letters)?

网站的 100% 是否已被编入索引?(您可以从设置页面查看).如果不是,并且运行 cron.php 不能解决问题,请往下看.

Has the 100% of the site being indexed? (You can check that from the setting page). If it is not, and running cron.php doesn't solve the matter, look further down.

重新索引能解决问题吗?特别是如果你直接在 Drupal 表上通过 SQL 查询插入数据,很可能 Drupal 没有意识到节点的内容已更改,因此不会更新索引.

Does a re-index solve the problem? Especially if you inserted data by mean of SQL queries directly on the Drupal tables, chances are Drupal hasn't realised the content of the node has changed and therefore doesn't update the index.

您要查找的节点是否可见?不会返回有关未发布节点或需要高于您的权限才能查看的节点的搜索结果,AFAIK.p>

Is the node you are trying to find, visible? Search results about unpublished nodes or nodes that require higher-than-yours permissions to be viewed are not returned, AFAIK.

至于发生在我身上的卡住索引".原来是节点主体中的一些 PHP 代码会在对节点进行索引时触发 PHP 异常,因此索引过程将停止,并且不会对以下所有节点进行索引.

As for the "stuck indexing" that happened to me once as well. It turned out it was some PHP code within a node body that would trigger a PHP exception when the node was being indexed, and as a result the indexing process would halt and all the following nodes would not be indexed as well.

希望这会有所帮助.祝你好运!

Hope this helps. Good luck!

这篇关于Drupal 搜索引擎不索引我的自定义节点!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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