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

Services/Search/classes/Fulltext/class.ilFulltextAdvancedSearch.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.ilAdvancedSearch.php';
00036 
00037 class ilFulltextAdvancedSearch extends ilAdvancedSearch
00038 {
00039 
00044         function ilFulltextAdvancedSearch(&$qp_obj)
00045         {
00046                 parent::ilAdvancedSearch($qp_obj);
00047         }
00048         function __createTaxonWhereCondition()
00049         {
00050                 // IN BOOLEAN MODE
00051                 if($this->db->isMysql4_0OrHigher())
00052                 {
00053                         $query .= " WHERE MATCH(taxon) AGAINST('";
00054                         foreach($this->query_parser->getQuotedWords(true) as $word)
00055                         {
00056                                 $query .= $word;
00057                                 $query .= '* ';
00058                         }
00059                         $query .= "' IN BOOLEAN MODE) ";
00060                 }
00061                 else
00062                 {
00063                         $query .= " WHERE MATCH (taxon) AGAINST(' ";
00064                         foreach($this->query_parser->getQuotedWords(true) as $word)
00065                         {
00066                                 $query .= $word;
00067                                 $query .= ' ';
00068                         }
00069                         $query .= "') ";
00070                 }
00071                 return $query;
00072         }               
00073         function __createKeywordWhereCondition()
00074         {
00075                 // IN BOOLEAN MODE
00076                 if($this->db->isMysql4_0OrHigher())
00077                 {
00078                         $query .= " WHERE MATCH(keyword) AGAINST('";
00079                         foreach($this->query_parser->getQuotedWords(true) as $word)
00080                         {
00081                                 $query .= $word;
00082                                 $query .= '* ';
00083                         }
00084                         $query .= "' IN BOOLEAN MODE) ";
00085                 }
00086                 else
00087                 {
00088                         $query .= " WHERE MATCH (keyword) AGAINST(' ";
00089                         foreach($this->query_parser->getQuotedWords(true) as $word)
00090                         {
00091                                 $query .= $word;
00092                                 $query .= ' ';
00093                         }
00094                         $query .= "') ";
00095                 }
00096                 return $query;
00097         }
00098 
00099         function __createLifecycleWhereCondition()
00100         {
00101                 // IN BOOLEAN MODE
00102                 if($this->db->isMysql4_0OrHigher())
00103                 {
00104                         $query .= " WHERE MATCH(meta_version) AGAINST('";
00105                         foreach($this->query_parser->getQuotedWords(true) as $word)
00106                         {
00107                                 $query .= $word;
00108                                 $query .= '* ';
00109                         }
00110                         $query .= "' IN BOOLEAN MODE) ";
00111                 }
00112                 else
00113                 {
00114                         $query .= " WHERE MATCH (meta_version) AGAINST(' ";
00115                         foreach($this->query_parser->getQuotedWords(true) as $word)
00116                         {
00117                                 $query .= $word;
00118                                 $query .= ' ';
00119                         }
00120                         $query .= "') ";
00121                 }
00122                 return $query;
00123         }               
00124 
00125         function __createEntityWhereCondition()
00126         {
00127                 // IN BOOLEAN MODE
00128                 if($this->db->isMysql4_0OrHigher())
00129                 {
00130                         $query .= " WHERE MATCH(entity) AGAINST('";
00131                         foreach($this->query_parser->getQuotedWords(true) as $word)
00132                         {
00133                                 $query .= $word;
00134                                 $query .= '* ';
00135                         }
00136                         $query .= "' IN BOOLEAN MODE) ";
00137                 }
00138                 else
00139                 {
00140                         $query .= " WHERE MATCH (entity) AGAINST(' ";
00141                         foreach($this->query_parser->getQuotedWords(true) as $word)
00142                         {
00143                                 $query .= $word;
00144                                 $query .= ' ';
00145                         }
00146                         $query .= "') ";
00147                 }
00148                 return $query;
00149         }               
00150         function __createCoverageAndCondition()
00151         {
00152                 // IN BOOLEAN MODE
00153                 if($this->db->isMysql4_0OrHigher())
00154                 {
00155                         $query .= " AND MATCH(coverage) AGAINST('";
00156                         foreach($this->query_parser->getQuotedWords(true) as $word)
00157                         {
00158                                 $query .= $word;
00159                                 $query .= '* ';
00160                         }
00161                         $query .= "' IN BOOLEAN MODE) ";
00162                 }
00163                 else
00164                 {
00165                         $query .= " AND MATCH (coverage) AGAINST(' ";
00166                         foreach($this->query_parser->getQuotedWords(true) as $word)
00167                         {
00168                                 $query .= $word;
00169                                 $query .= ' ';
00170                         }
00171                         $query .= "') ";
00172                 }
00173                 return $query;
00174         }       
00175 
00176         function __createTitleDescriptionWhereCondition()
00177         {
00178                 // IN BOOLEAN MODE
00179                 if($this->db->isMysql4_0OrHigher())
00180                 {
00181                         $query .= " WHERE MATCH(title,description) AGAINST('";
00182                         foreach($this->query_parser->getQuotedWords(true) as $word)
00183                         {
00184                                 $query .= $word;
00185                                 $query .= '* ';
00186                         }
00187                         $query .= "' IN BOOLEAN MODE) ";
00188                 }
00189                 else
00190                 {
00191                         $query .= " WHERE MATCH (title,description) AGAINST(' ";
00192                         foreach($this->query_parser->getQuotedWords(true) as $word)
00193                         {
00194                                 $query .= $word;
00195                                 $query .= ' ';
00196                         }
00197                         $query .= "') ";
00198                 }
00199                 return $query;
00200         }               
00201         
00202         // Private
00203 }
00204 ?>

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