Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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
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
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
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
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
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
00203 }
00204 ?>