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

查看:92
本文介绍了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.

但是,对于非常繁忙的大型网站,人们更喜欢使用外部工具,例如Google搜索框,甚至专用软件或硬件,例如solr / lucene或Google Search Appliance(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 ,该词按词干对其进行索引(例如:最高,最高和最高都将作为单词 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.

重新索引是否可以解决问题?特别是如果您通过SQL查询直接在Drupal表上插入数据,则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.

您要查找的节点是否可见?搜索有关未发布节点或节点的结果

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天全站免登陆