【问题标题】:No Hits Found Using Zend Lucene Search使用 Zend Lucene 搜索未找到任何命中
【发布时间】:2009-05-23 18:50:50
【问题描述】:

所以我一直在编写一个爬虫脚本,以使用 Zend Lucene 搜索来索引我网站上的所有页面。我已经能够让脚本工作,但由于某种原因在页面上找不到其他链接。问题似乎出在脚本命中 find 方法时:

$hits = $index->find('url:'.$targets[$i]);

当我执行脚本时,数组中没有命中,因此爬虫仅索引起始 URI。关于我可以尝试什么的任何想法?

【问题讨论】:

  • 你确定你没有覆盖每个类型的 $hits 吗?

标签: zend-framework search lucene


【解决方案1】:

有一个工具可以查看 lucene 索引,它可以让您查看正在索引的内容。 Luke 应该让您查看已编入索引的内容并测试一些搜索。

您确定在创建索引时 url 字段已被索引,您可能只是存储信息而不是可搜索:

addField(Zend_Search_Lucene_Field::UnIndexed

不会被找到,因为它没有被索引

【讨论】:

    【解决方案2】:

    如果您的索引中有数字,这将有所帮助。

    要识别数字,请使用: Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()); 作为默认分析器。 有关更多信息,请参阅 http://framework.zend.com/manual/en/zend.search.lucene.extending.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-06
      • 1970-01-01
      • 2023-03-23
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-23
      相关资源
      最近更新 更多