ĈҤ,+Ӑ&Ĉ¬1Ҹ1* 75ѬӠ1*ĈҤ,+Ӑ&6Ѭ3+Ҥ0 KHOA TIN -[ \ - TR1+;8ặ1/, ;ặaddField(Zend_Search_ Lucene_Field :: Text ('name', $data[$i]['document_name'])); $product[$i] - >addField(Zend_Search_Lucene_Field ::Text ('author', $data[$i]['document_auhtor'])); $product[$i] - >addField(Zend_Search_Lucene_Field ::text ('content', $data[$i]['document_content'])); $product[$i] - >addField(Zend_Search_Lucene_Field ::text ('sumary', $data[$i]['document_sumary']); $product[$i] - >addField(Zend_Search_lucene_Field keyw ord('topic',$data[$i]['document $product[$i] :: topic'])); - >addField(Zend_Search_Lucene_Field :: unIndexed ('id', $data[$i]['document_id'])); $Index - >addDocument($product[$i]); } } 6LQKYLrQWKӵFKLӋQ : 7UӏQK;XkQ/ӧL Trang 36 ;k\GӵQJ+ӋWKӕQJWuPNLӃPQӝLGXQJILOHYăQ /ӟS=HQGB6HDUFKB/XFHQHB)LHOG[ӱOêY OLӋX9jÿӇWҥRUDFiFOƭQKYӵFÿyFK~ Keyword: /ƭQKYӵFÿѭӧFOѭXWUӳYjOұSFK DOjKӑFyWK WuPNLӃPFNJQJQKѭKLӇQWKӏWURQJNӃWT FiFWӯULrQJELӋWFӫDWRNHQL]DWLRQ&i GӏFKVDQJFiFOƭQKYӵFWӯNKRiWURQJ=H UnIndexed: /ƭQK YӵFNK{QJSKҧLOjWuPNLӃP WUX\FұSWuPNLӃP&iFWLPHVWDPSVFѫV WұS WLQ Yj QKұQ GҥQJ ErQ QJRjL NKiF UnIndexed Binary: /ƭQKYӵFNK{QJÿѭӧFWRNHQ L]HGOұSFKӍPөFQKѭ WKXKӗLYӟLVӕWUX\FұSWuPNLӃP&K~Q OLӋXÿѭӧFPmKyDQKѭOjPӝWFKXӛLQKӏ ҧQK Text: ĈѭӧFOѭXWUӳOұSFKӍPөFYjWRN YӵFWH[WOjWK OѭXWUӳWK{QJWLQQKѭÿӕLWѭӧQJYjWLr YӟLNӃWTXҧWuPNLӃP UnStored/ƭQKYӵFÿѭӧFWRNHQL]HGYjOұS WUӳWURQJFKӍPөF6ӕOѭӧQJOӟQFiFYăQ ӍPөFWӕWQKҩWE GөQJFӫDOƭQKYӵFQj\/ѭXWUӳGӳOLӋX FK~QJ FҫQ WuP NLӃP QKѭQJ NK{QJ KLӇQ W UnStored c Upload Document &NJQJWѭѫQJWӵQKѭFUHDWHGLQGH[FKӍ KiFOjWKD\SKѭѫQJW Open() thay WKӃFKRSKѭѫQJWKӭF Create() class FindController extends Zend_Controller_Action { public function createIndexAction () { //Create an index $Index = Zend_Search_Lucene::open('application/ searchdocume nt'); 6LQKYLrQWKӵFKLӋQ : 7UӏQK;XkQ/ӧL Trang 37 ;k\GӵQJ+ӋWKӕQJWuPNLӃPQӝLGXQJILOHYăQ //Add Document to File Index $product[$i]= new Zend_Search_Lucene_Document(); $product[$i] - >addField(Zend_Search_Lucene_Field ::Text('Url', $data[$i]['document_url'], 'utf - 8')); $Index - >addDocument($product[$i]); } } 1.3.3.3 7uPNL͇PWK{QJWLQ a ;k\GQJFiFWUX\Y̭Q &yFiFKÿӇWuPNLӃPFiFFKӍPөF - 7KӭQKҩWV ӱGөQJF~SKiSSKkQWtFKWUX\ - 7KӭKDLWUX\YҩQWK{QJTXD$3,Fӫ 6ӱ GөQJ F~ SKiS SKkQ WtFK WUX\ Y QueryParser :: SDUVH ÿӇSKkQWtFKFiFFKXӛLWU $nameQuery = Zend_Search_Lucene_Search_QueryParser ::parse ($queryStr); $contentQuery=Zend_Search_Lucene_Search_QueryParser ::parse($queryStr); $query = new Zend_Search_Lucene_Search_ Query_Boolean (); $query - >addSubquery($nameQuery) $query - >addSubquery($contentQuery) $hits = $index - >find($query); =HQGB6HDUFKB/XFHQH )LQG Oj ÿҫXYjRWӵÿӝQJYjVӱGөQJSKkQWtFKF WѭӧQJ =HQGB6HDUFKB/XFHQHB6HDUFKB4XHU\WKtFKK Zend_Search_Lucene )LQG Oj SKѭѫQJ SKi YjR Wӵ ÿӝQJ Yj Vӱ GөQJ SKkQ WtFK F~ S Zend_Search_Lucene_Search_Query thích hӧSWӯPӝWÿҫXYjRFӫD b .͇WTX̫WL͉PNL͇P ӃW TXҧ KLӇQ WKӏ Oj PӝW PҧQJ FӫD F Search_QueryHit 6LQKYLrQWKӵFKLӋQ : 7UӏQK;XkQ/ӧL Trang 38 ;k\GӵQJ+ӋWKӕQJWuPNLӃPQӝLGXQJILOHYăQ 0ӛL PӝW NӃW TXҧ WuP NLӃP -!LG ÿѭӧF OjJӗP Vӕ ÿ ÿiQKWURQJFKӍPөFKLW -!VFRUHOjVӕÿѭӧFÿiQKWURQ JNӃWTXҧ9jFi ÿѭӧFVҳS[ӃSWKHRKLW -!VFRUHJLҧPGҫQWӯKLW -!VFRUHFDRQKҩW ĈӕLWѭӧQJ=HQGB6HDUFKB/XFHQHB6HDUFK ÿӕLWѭӧQJ=HQGB6HDUFKB/XFHQHB'RFXPHQW 9tGө $index = Zend_Search_Lucene::open ('/applicat ion /searchdocument); $hits = $index - >find ($query); foreach ($hits as $hit) { echo $hit - >name; echo $hit - >content; echo $hit - >author; 9tGөQj\VӁFKRUDNӃWTXҧOjILO QӝLGөQJYjWiFJLҧFӫDWjLOLӋX 1.3.4 ĈiQ h JLiÿ͡FKtQK[iFFͯDK͏WK͙QJ &y QKLӅX FiFK ÿR OѭӡQJ NKiF QKDX FK TXҧFӫDPӝWKӋWKӕQJWuPNLӃPWK{QJWLQ OLӋX Yj PӝW FkX WUX\ YҩQ WұSӇ WjL OLrQ OLӋX TX KRһFNK{QJOLrQTXDQÿӃQFkXWUX\YҩQ Ĉ͡FKtQK[iF : ĈѭӧFÿREӣLWӍOӋFӫDWjLOLӋX OLӋXQKұQÿѭӧFKyD ^7jLOL͏XOLrQTXDQ` ŀ ^7jLOL͏XQK̵Qÿ˱ͫF` Ĉ͡FKtQK[iF {TjLOL͏XQK̵Qÿ˱ͫF` 6LQKYLrQWKӵFKLӋQ : 7UӏQK;XkQ/ӧL Trang 39 ;k\GӵQJ+ӋWKӕQJWuPNLӃPQӝLGXQJILOHYăQ Ĉ͡EDR SKͯ : ĈѭӧFÿ REӣLWӍOӋWjLOLӋXWUҧYӅ [iFWUrQWәQJF có liên quan ^7jLOL͏XOLrQTXDQ` ŀ ^7jLOL͏XQK̵Qÿ˱ͫF` Ĉ͡EDRSKͯ ^7jLOL͏XOLrQTXDQ` ͇WTX̫VDL : ĈѭӧFÿ REӣLWӍOӋFiFWjLOLӋXNK g liên quan trҧYӅWUrQ FiFWjLOLӋXNK{QJOLrQTXDQ ^7jLOL͏XNK{QJOLrQTXDQ` ŀ ^7jLOLXQKQF` WTXVDL ^7jLOLXNK{QJOLrQTXDQ` 6LQKYLrQWKFKLQ : 7UQK;XkQ/L Trang 40 &KQJ 3+ặ17ậ&+9ơ7+,7.+7+1* 2.1 ĈһFWҧFiFXVHFDVHWURQJKӋWKӕQJ 2.1.1 &iFWiFYөOLrQTXDQÿӃQPRGXOHDG 2.1.1.1 Use-FDVHW͝QJTXDQPRGXOHDGPLQ Logs into systern Login page No Pemission system of user groups Yes Home page Update GroupUser Update User Update Product_topic Update Product_Spectialty My SQL database Hình 2.1 7UDQJFKͯDGPLQ 2.1.1.2 Use-case login - 0ͭF ÿtFK Dành cho user có WURQJ KӋ WKӕQJ JӗP Administrator, Teacher Sinh YLrQ PXӕQ ÿăQJQKұSYjR K WLQYj KRҥW ÿӝQJ WKHR FKӭF QăQJ SKkQ T QJѭӡLGQJWURQJKӋWKӕQJ - ĈL͉XNL͏QWLrQTX\͇W /jQKӳQJWKjQKYLrQFyWj - Tác nhân chính: Founder, Administrator, Teachers, User - ĈL͉XNL͏QO͟L 7rQÿăQJQKұSKRһFPұWNKҭX 6LQKYLrQWKӵFKLӋQ 7UӏQK;XkQ/ӧL Trang 41 Xây dӵQJ +ӋWKӕQJWuPNLӃPQӝLGXQJWUrQILOHYăQ - In put: 7rQÿăQJQKұS (EҳW EXӝFQKұS 0ұWNKҭX EҳW EXӝFQKұS ... 20 1.2.4.1 Zend_ Acl .21 1.2.4.2 Zend_ Auth .21 1.2.4.3 Zend _File 22 1.2.4.4 Zend_ Form 22 1.2.4.5 Zend_ Db .23 1.2.4.6 Zend_ View ... FKӭFFӫDPӝWӭQJGөQJ Zend Fremawork 1.2.1 7͝QJTXD QY͉ Zend Fremawork 1.2.1.1 Zend Fremawork gì? - Zend Fremawork OjPӝWPmQJXӗQPӣÿѭӧFSKiW FKXҭQKyDÿӕLWѭӧQJ Zend Fremawork WKѭӡQJÿѭӧFJӑLOj³WK... Fremawork 1.2.2.1 Mơ hình MVC Zend Fremawork Bootstrap File: index.php (Database connection) Controller File (Application logic) Model File (Database query) View template File (HTML) Hình 1.3 0{KuQK09&FͯD=HQG