本文整理汇总了PHP中Indexer::phonetics方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::phonetics方法的具体用法?PHP Indexer::phonetics怎么用?PHP Indexer::phonetics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::phonetics方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a document db row.
*
* @global string $urlServer
* @param object $docu
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($docu) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'doc_' . $docu->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $docu->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'doc', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $docu->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($docu->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics($docu->description), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('filename', Indexer::phonetics($docu->filename), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('comment', Indexer::phonetics($docu->comment), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('creator', Indexer::phonetics($docu->creator), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('subject', Indexer::phonetics($docu->subject), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('author', Indexer::phonetics($docu->author), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('visible', $docu->visible, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('public', $docu->public, $encoding));
$urlAction = ($docu->format == '.dir') ? 'openDir' : 'download';
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer
. 'modules/document/index.php?course=' . course_id_to_code($docu->course_id)
. '&' . $urlAction . '=' . $docu->path, $encoding));
return $doc;
}
示例2: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a link db row.
*
* @global string $urlServer
* @param object $link
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($link) {
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'link_' . $link->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $link->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'link', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $link->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($link->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics(strip_tags($link->description)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $link->url, $encoding));
return $doc;
}
示例3: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a video db row.
*
* @global string $urlServer
* @param object $video
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($video) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'video_' . $video->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $video->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'video', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $video->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($video->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics($video->description), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/video/file.php?course=' . course_id_to_code($video->course_id) . '&id=' . $video->id, $encoding));
return $doc;
}
示例4: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a forum topic db row.
*
* @global string $urlServer
* @param object $ftopic
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($ftopic) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'ftopic_' . $ftopic->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $ftopic->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'ftopic', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $ftopic->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('forumid', $ftopic->forum_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($ftopic->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/forum/viewforum.php?course=' . course_id_to_code($ftopic->course_id)
. '&forum=' . intval($ftopic->forum_id), $encoding));
return $doc;
}
示例5: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of an announcement db row.
*
* @global string $urlServer
* @param object $announce
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($announce) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'announce_' . $announce->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $announce->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'announce', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $announce->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($announce->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics(strip_tags($announce->content)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('visible', $announce->visible, $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/announcements/index.php?course=' . course_id_to_code($announce->course_id) . '&an_id=' . $announce->id, $encoding));
return $doc;
}
示例6: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of an exercise db row.
*
* @global string $urlServer
* @param object $exercise
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($exercise) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'exercise_' . $exercise->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $exercise->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'exercise', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $exercise->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($exercise->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics(strip_tags($exercise->description)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('visible', $exercise->active, $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/exercise/exercise_submit.php?course=' . course_id_to_code($exercise->course_id) . '&exerciseId=' . $exercise->id, $encoding));
return $doc;
}
示例7: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a forum post row.
*
* @global string $urlServer
* @param object $fpost
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($fpost) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'fpost_' . $fpost->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $fpost->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'fpost', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $fpost->course_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('topicid', $fpost->topic_id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics(strip_tags($fpost->post_text)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/forum/viewtopic.php?course=' . course_id_to_code($fpost->course_id)
. '&topic=' . intval($fpost->topic_id)
. '&forum=' . intval($fpost->forum_id), $encoding));
return $doc;
}
示例8: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a note db row.
*
* @global string $urlServer
* @param object $note
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($note) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'note_' . $note->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $note->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'note', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('userid', $note->user_id, $encoding));
if(isset($note->course_id)){
$doc->addField(Zend_Search_Lucene_Field::Keyword('courseid', $note->course_id, $encoding));
}
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($note->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('content', Indexer::phonetics(strip_tags($note->content)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'modules/notes/index.php?an_id=' . $note->id, $encoding));
return $doc;
}
示例9: makeDoc
/**
* Construct a Zend_Search_Lucene_Document object out of a course db row.
*
* @global string $urlServer
* @param object $course
* @return Zend_Search_Lucene_Document
*/
protected function makeDoc($course) {
global $urlServer;
$encoding = 'utf-8';
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', 'course_' . $course->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('pkid', $course->id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword('doctype', 'course', $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('code', Indexer::phonetics($course->code), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('title', Indexer::phonetics($course->title), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('keywords', Indexer::phonetics($course->keywords), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('visible', $course->visible, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('prof_names', Indexer::phonetics($course->prof_names), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('public_code', Indexer::phonetics($course->public_code), $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text('units', Indexer::phonetics(strip_tags($course->units)), $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('created', $course->created, $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('url', $urlServer . 'courses/' . $course->code, $encoding));
return $doc;
}