MDL-9115 Added new strings to lang/en_utf8/group.php (where in roles.php before!...
[moodle-pu.git] / search / documents / document.php
blob466302fdc70b47025efd55fe3ac1183c7eb4ebd6
1 <?php
2 /* Base search document from which other module/block types can
3 * extend.
4 * */
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));
21 } //constructor
22 } //SearchDocument