Hi,

Can you help me in finding the error, for the following code.

<?php
require_once statements ....;
$index = Zend_Search_Lucene::create('/data/my_index');
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Text('type','auto'));
$index->addDocument($doc);

$pattern = new Zend_Search_Lucene_Index_Term('auto*');
$query = new Zend_Search_Lucene_Search_Query_Wildcard($pattern);
$hits  = $index->find($query);
foreach ($hits as $hit){
    echo $hit->type;
}
?>

After successful execution of the above script, output should be *auto*. But
it is giving empty output and the array $hits size is 0.

Can you please help in finding the reason behind this?
-

-
Thanks,
Lalit

Building better communities with better communication.

World's biggest collection of Most Practical Green Living ideas --
http://www.commonfloor.com/green-living

Reply via email to