J'ai une autre question: ma base de données existe déjà et comporte plusieurs enregistrements, notamment dans la table catalogue qui a ~125000 enregistrements.
Dans le tuto de jobeet ils font:
1 2 3 4 5 6 7 8 9
| <?php ...
if (file_exists($index = self::getLuceneIndexFile()))
{
return Zend_Search_Lucene::open($index);
}
else
{
return Zend_Search_Lucene::create($index);
} |
La fonction create() n'est pas à l'image de la fonction updateLuceneIndex() défini par l'utilisateur. En effet sur la fonction updateLuceneIndex()
on précise ce sur quoi on veut créer l'index:
1 2 3 4 5
| // index job fields
$doc->addField(Zend_Search_Lucene_Field::UnStored('position', $this->getPosition(), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::UnStored('company', $this->getCompany(), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::UnStored('location', $this->getLocation(), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::UnStored('description', $this->getDescription(), 'utf-8')); |
Ma question est donc la suivante: comment savoir et parametrer ce sur quoi on créer un index lorsque l'on appelle:
Zend_Search_Lucene::create($index);
Partager