• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Search/classes/Fulltext/class.ilFulltextMetaDataSearch.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00035 include_once 'Services/Search/classes/class.ilMetaDataSearch.php';
00036 
00037 class ilFulltextMetaDataSearch extends ilMetaDAtaSearch
00038 {
00039 
00044         function ilFulltextMetaDataSearch(&$qp_obj)
00045         {
00046                 parent::ilMetaDataSearch($qp_obj);
00047         }
00048 
00049         // Private
00050         function __createKeywordWhereCondition()
00051         {
00052                 // IN BOOLEAN MODE
00053                 if($this->db->isMysql4_0OrHigher())
00054                 {
00055                         $query .= " WHERE MATCH(keyword) AGAINST('";
00056                         foreach($this->query_parser->getQuotedWords(true) as $word)
00057                         {
00058                                 $query .= $word;
00059                                 $query .= '* ';
00060                         }
00061                         $query .= "' IN BOOLEAN MODE) ";
00062                 }
00063                 else
00064                 {
00065                         // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
00066                         $query .= " WHERE MATCH (keyword) AGAINST(' ";
00067                         foreach($this->query_parser->getQuotedWords(true) as $word)
00068                         {
00069                                 $query .= $word;
00070                                 $query .= ' ';
00071                         }
00072                         $query .= "') ";
00073                 }
00074                 return $query;
00075         }               
00076         function __createContributeWhereCondition()
00077         {
00078                 // IN BOOLEAN MODE
00079                 if($this->db->isMysql4_0OrHigher())
00080                 {
00081                         $query .= " WHERE MATCH(entity) AGAINST('";
00082                         foreach($this->query_parser->getQuotedWords(true) as $word)
00083                         {
00084                                 $query .= $word;
00085                                 $query .= '* ';
00086                         }
00087                         $query .= "' IN BOOLEAN MODE) ";
00088                 }
00089                 else
00090                 {
00091                         // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
00092                         $query .= " WHERE MATCH (entity) AGAINST(' ";
00093                         foreach($this->query_parser->getQuotedWords(true) as $word)
00094                         {
00095                                 $query .= $word;
00096                                 $query .= ' ';
00097                         }
00098                         $query .= "') ";
00099                 }
00100                 return $query;
00101         }               
00102         function __createTitleWhereCondition()
00103         {
00104                 // IN BOOLEAN MODE
00105                 if($this->db->isMysql4_0OrHigher())
00106                 {
00107                         $query .= " WHERE MATCH(title,coverage) AGAINST('";
00108                         foreach($this->query_parser->getQuotedWords(true) as $word)
00109                         {
00110                                 $query .= $word;
00111                                 $query .= '* ';
00112                         }
00113                         $query .= "' IN BOOLEAN MODE) ";
00114                 }
00115                 else
00116                 {
00117                         // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
00118                         $query .= " WHERE MATCH (title,coverage) AGAINST(' ";
00119                         foreach($this->query_parser->getQuotedWords(true) as $word)
00120                         {
00121                                 $query .= $word;
00122                                 $query .= ' ';
00123                         }
00124                         $query .= "') ";
00125                 }
00126                 return $query;
00127         }               
00128         function __createDescriptionWhereCondition()
00129         {
00130                 // IN BOOLEAN MODE
00131                 if($this->db->isMysql4_0OrHigher())
00132                 {
00133                         $query .= " WHERE MATCH(description) AGAINST('";
00134                         foreach($this->query_parser->getQuotedWords(true) as $word)
00135                         {
00136                                 $query .= $word;
00137                                 $query .= '* ';
00138                         }
00139                         $query .= "' IN BOOLEAN MODE) ";
00140                 }
00141                 else
00142                 {
00143                         // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
00144                         $query .= " WHERE MATCH (description) AGAINST(' ";
00145                         foreach($this->query_parser->getQuotedWords(true) as $word)
00146                         {
00147                                 $query .= $word;
00148                                 $query .= ' ';
00149                         }
00150                         $query .= "') ";
00151                 }
00152                 return $query;
00153         }               
00154 }
00155 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1