Hi everybody,
my problem is following. When i work with a small index (~ 50 documents)
everythink is fine. But when i indexing more than 70 documents following
error occurred:
Message: Field name "fi_object" not found in document.
Stack trace: ...
None of the fields was founded but $index->count(); contains an integer
which is greater than zero.
If i try this one:
foreach ($hits as $hit) {
echo $document = $hit->getDocument();
}
i get that error:
Catchable fatal error: Object of class Zend_Search_Lucene_Document could not
be converted to string in
C:\xampp\htdocs\search\application\controllers\IndexController.php on line
61
Here is my create-index-method:
public function createindexAction() {
Zend_Search_Lucene_Analysis_Analyzer::setDefault(
new
Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()
);
$index = Zend_Search_Lucene::create($this->SEARCHPATH);
$config = Zend_Registry::get('configuration');
$db = Zend_Db::factory($config->database);
$sql = 'SELECT m.id_meta, m.headline, m.fi_object, c.text
FROM meta AS m
INNER JOIN content AS c ON m.id_meta = c.fi_meta
WHERE m.publication_start_date <= UNIX_TIMESTAMP()';
$newsList = $db->fetchAll($sql);
for($i = 0; $i < count($newsList); $i++) {
$document = new Zend_Search_Lucene_Document();
$document->addField(Zend_Search_Lucene_Field::Keyword('id_meta',$newsList[$i]['id_meta'],'utf-8'));
$document->addField(Zend_Search_Lucene_Field::Keyword('fi_object',$newsList[$i]['fi_object'],'utf-8'));
$document->addField(Zend_Search_Lucene_Field::Text('headline',$newsList[$i]['headline'],'utf-8'));
$document->addField(Zend_Search_Lucene_Field::unStored('text',
strip_tags($newsList[$i]['text']),'utf-8'));
$index->addDocument($document);
}
$index->commit();
}
And my search-action:
public function searchAction() {
Zend_Search_Lucene_Analysis_Analyzer::setDefault(
new
Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()
);
$index = Zend_Search_Lucene::open($this->SEARCHPATH);
Zend_Search_Lucene::setResultSetLimit($this->resultLimit);
$hits = $index->find('test');
foreach ($hits as $hit) {
echo $hit->score;
echo $hit->headline;
}
}
thanks for any advices
--
View this message in context:
http://old.nabble.com/zend_search_lucene-tp26335575p26335575.html
Sent from the Zend Framework mailing list archive at Nabble.com.