ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilFulltextAdvancedSearch.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once 'Services/Search/classes/class.ilAdvancedSearch.php';
25 
38 {
39 
44  function ilFulltextAdvancedSearch(&$qp_obj)
45  {
46  parent::ilAdvancedSearch($qp_obj);
47  }
49  {
50  // IN BOOLEAN MODE
51  if($this->db->isMysql4_0OrHigher())
52  {
53  $query .= " WHERE MATCH(taxon) AGAINST('";
54  foreach($this->query_parser->getQuotedWords(true) as $word)
55  {
56  $query .= $word;
57  $query .= '* ';
58  }
59  $query .= "' IN BOOLEAN MODE) ";
60  }
61  else
62  {
63  $query .= " WHERE MATCH (taxon) AGAINST(' ";
64  foreach($this->query_parser->getQuotedWords(true) as $word)
65  {
66  $query .= $word;
67  $query .= ' ';
68  }
69  $query .= "') ";
70  }
71  return $query;
72  }
74  {
75  // IN BOOLEAN MODE
76  if($this->db->isMysql4_0OrHigher())
77  {
78  $query .= " WHERE MATCH(keyword) AGAINST('";
79  foreach($this->query_parser->getQuotedWords(true) as $word)
80  {
81  $query .= $word;
82  $query .= '* ';
83  }
84  $query .= "' IN BOOLEAN MODE) ";
85  }
86  else
87  {
88  $query .= " WHERE MATCH (keyword) AGAINST(' ";
89  foreach($this->query_parser->getQuotedWords(true) as $word)
90  {
91  $query .= $word;
92  $query .= ' ';
93  }
94  $query .= "') ";
95  }
96  return $query;
97  }
98 
100  {
101  // IN BOOLEAN MODE
102  if($this->db->isMysql4_0OrHigher())
103  {
104  $query .= " WHERE MATCH(meta_version) AGAINST('";
105  foreach($this->query_parser->getQuotedWords(true) as $word)
106  {
107  $query .= $word;
108  $query .= '* ';
109  }
110  $query .= "' IN BOOLEAN MODE) ";
111  }
112  else
113  {
114  $query .= " WHERE MATCH (meta_version) AGAINST(' ";
115  foreach($this->query_parser->getQuotedWords(true) as $word)
116  {
117  $query .= $word;
118  $query .= ' ';
119  }
120  $query .= "') ";
121  }
122  return $query;
123  }
124 
126  {
127  // IN BOOLEAN MODE
128  if($this->db->isMysql4_0OrHigher())
129  {
130  $query .= " WHERE MATCH(entity) AGAINST('";
131  foreach($this->query_parser->getQuotedWords(true) as $word)
132  {
133  $query .= $word;
134  $query .= '* ';
135  }
136  $query .= "' IN BOOLEAN MODE) ";
137  }
138  else
139  {
140  $query .= " WHERE MATCH (entity) AGAINST(' ";
141  foreach($this->query_parser->getQuotedWords(true) as $word)
142  {
143  $query .= $word;
144  $query .= ' ';
145  }
146  $query .= "') ";
147  }
148  return $query;
149  }
151  {
152  // IN BOOLEAN MODE
153  if($this->db->isMysql4_0OrHigher())
154  {
155  $query .= " AND MATCH(coverage) AGAINST('";
156  foreach($this->query_parser->getQuotedWords(true) as $word)
157  {
158  $query .= $word;
159  $query .= '* ';
160  }
161  $query .= "' IN BOOLEAN MODE) ";
162  }
163  else
164  {
165  $query .= " AND MATCH (coverage) AGAINST(' ";
166  foreach($this->query_parser->getQuotedWords(true) as $word)
167  {
168  $query .= $word;
169  $query .= ' ';
170  }
171  $query .= "') ";
172  }
173  return $query;
174  }
175 
177  {
178  // IN BOOLEAN MODE
179  if($this->db->isMysql4_0OrHigher())
180  {
181  $query .= " WHERE MATCH(title,description) AGAINST('";
182  foreach($this->query_parser->getQuotedWords(true) as $word)
183  {
184  $query .= $word;
185  $query .= '* ';
186  }
187  $query .= "' IN BOOLEAN MODE) ";
188  }
189  else
190  {
191  $query .= " WHERE MATCH (title,description) AGAINST(' ";
192  foreach($this->query_parser->getQuotedWords(true) as $word)
193  {
194  $query .= $word;
195  $query .= ' ';
196  }
197  $query .= "') ";
198  }
199  return $query;
200  }
201 
202  // Private
203 }
204 ?>