views:

368

answers:

2

Hi,
I'm wanting to add a search box onto my website - which is built using Zend Framework 1.6 - using Zend Search Lucene. The majority of my content is static, and held within Controller Views.

Does anyone have a script that can index content from the views, and add them into the Lucene search database so I can search them?

Many thanks,
Matt

+1  A: 

Just an idea: you could use

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

If allow_url_fopen is set to 1 the call to file_get_contents() used in Zend_Search_Lucene_Document_Html::__construct() should be able to open files via an url.

Stefan Gehrig
A: 

Hi,
Thanks for your post - i'll give it a try. If that works, it shouldn't be too hard to recursively spider the links on the site, adding each internal link to the index.

I'll post back if I make some headway.

Matt

fistameeny