Wildcard Query in Zend Lucene

tawnym198

New Member
\[code\]$index = Zend_Search_Lucene::open("/data/my_index1");$doc = new Zend_Search_Lucene_Document();$doc->addField(Zend_Search_Lucene_Field::Text('type','auto'));$index->addDocument($doc);$term = new Zend_Search_Lucene_Index_Term('auto*');$query = new Zend_Search_Lucene_Search_Query_Wildcard($term);$hits = $index->find($query);foreach ($hits as $hit){ echo $hit->type;}\[/code\]After successful execution of this code, it needs to print auto. But array $hits is empty.What is the reason behind this?
 
Back
Top