【问题标题】:Zend Framework - Is there a script to index static content from Views?Zend Framework - 是否有脚本来索引视图中的静态内容?
【发布时间】:2010-09-20 18:36:29
【问题描述】:

我想在我的网站上添加一个搜索框——它是使用 Zend Framework 1.6 构建的——使用 Zend Search Lucene。我的大部分内容是静态的,并保存在控制器视图中。

有没有人有一个脚本可以索引视图中的内容,并将它们添加到 Lucene 搜索数据库中以便我可以搜索它们?

非常感谢,
马特

【问题讨论】:

    标签: php zend-framework search lucene


    【解决方案1】:

    只是一个想法:你可以使用

    $doc = Zend_Search_Lucene_Document_Html::loadHTMLFile('http://my.host.domain/path2file');
    $index->addDocument($doc);
    

    如果allow_url_fopen 设置为1,则Zend_Search_Lucene_Document_Html::__construct() 中使用的file_get_contents() 调用应该能够通过url 打开文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多