2 /* Base search document from which other module/block types can
6 abstract class SearchDocument
extends Zend_Search_Lucene_Document
{
7 public function __construct(&$doc, &$data, $document_type, $course_id, $group_id) {
8 $this->addField(Zend_Search_Lucene_Field
::Keyword('docid', $doc->docid
));
9 $this->addField(Zend_Search_Lucene_Field
::Text('title', $doc->title
));
10 $this->addField(Zend_Search_Lucene_Field
::Text('author', $doc->author
));
11 $this->addField(Zend_Search_Lucene_Field
::UnStored('contents', $doc->contents
));
12 $this->addField(Zend_Search_Lucene_Field
::UnIndexed('url', $doc->url
));
13 $this->addField(Zend_Search_Lucene_Field
::UnIndexed('date', $doc->date
));
15 //additional data added on a per-module basis
16 $this->addField(Zend_Search_Lucene_Field
::Binary('data', serialize($data)));
18 $this->addField(Zend_Search_Lucene_Field
::Keyword('doctype', $document_type));
19 $this->addField(Zend_Search_Lucene_Field
::Keyword('course_id', $course_id));
20 $this->addField(Zend_Search_Lucene_Field
::Keyword('group_id', $group_id));