Carl.Vondrick a écrit :
What is the best way to do a many-to-many relationship in Zend_Search_Lucene?
For instance, suppose I have index of a blog and I wish for users to be able
to search by a tag. A post can have many tags and a tag can have many
posts.
The approach I would like to take to index is:
<?php
foreach ($tags as $tag)
{
$document->addField(Zend_Search_Lucene_Field::Keyword($tag, 'tag'));
}
?>
We have a similar setup, we just concatenate the tags :
$document->addField(Zend_Search_Lucene_Field::Keyword(implode(', ',
$tags), 'tag'));
--
Christophe