ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilFulltextMetaDataSearch.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 
35 include_once 'Services/Search/classes/class.ilMetaDataSearch.php';
36 
38 {
39 
44  function ilFulltextMetaDataSearch(&$qp_obj)
45  {
46  parent::ilMetaDataSearch($qp_obj);
47  }
48 
49  // Private
51  {
52  // IN BOOLEAN MODE
53  if($this->db->isMysql4_0OrHigher())
54  {
55  $query .= " WHERE MATCH(keyword) AGAINST('";
56  foreach($this->query_parser->getQuotedWords(true) as $word)
57  {
58  $query .= $word;
59  $query .= '* ';
60  }
61  $query .= "' IN BOOLEAN MODE) ";
62  }
63  else
64  {
65  // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
66  $query .= " WHERE MATCH (keyword) AGAINST(' ";
67  foreach($this->query_parser->getQuotedWords(true) as $word)
68  {
69  $query .= $word;
70  $query .= ' ';
71  }
72  $query .= "') ";
73  }
74  return $query;
75  }
77  {
78  // IN BOOLEAN MODE
79  if($this->db->isMysql4_0OrHigher())
80  {
81  $query .= " WHERE MATCH(entity) AGAINST('";
82  foreach($this->query_parser->getQuotedWords(true) as $word)
83  {
84  $query .= $word;
85  $query .= '* ';
86  }
87  $query .= "' IN BOOLEAN MODE) ";
88  }
89  else
90  {
91  // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
92  $query .= " WHERE MATCH (entity) AGAINST(' ";
93  foreach($this->query_parser->getQuotedWords(true) as $word)
94  {
95  $query .= $word;
96  $query .= ' ';
97  }
98  $query .= "') ";
99  }
100  return $query;
101  }
103  {
104  // IN BOOLEAN MODE
105  if($this->db->isMysql4_0OrHigher())
106  {
107  $query .= " WHERE MATCH(title,coverage) AGAINST('";
108  foreach($this->query_parser->getQuotedWords(true) as $word)
109  {
110  $query .= $word;
111  $query .= '* ';
112  }
113  $query .= "' IN BOOLEAN MODE) ";
114  }
115  else
116  {
117  // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
118  $query .= " WHERE MATCH (title,coverage) AGAINST(' ";
119  foreach($this->query_parser->getQuotedWords(true) as $word)
120  {
121  $query .= $word;
122  $query .= ' ';
123  }
124  $query .= "') ";
125  }
126  return $query;
127  }
129  {
130  // IN BOOLEAN MODE
131  if($this->db->isMysql4_0OrHigher())
132  {
133  $query .= " WHERE MATCH(description) AGAINST('";
134  foreach($this->query_parser->getQuotedWords(true) as $word)
135  {
136  $query .= $word;
137  $query .= '* ';
138  }
139  $query .= "' IN BOOLEAN MODE) ";
140  }
141  else
142  {
143  // i do not see any reason, but MATCH AGAINST(...) OR MATCH AGAINST(...) does not use an index
144  $query .= " WHERE MATCH (description) AGAINST(' ";
145  foreach($this->query_parser->getQuotedWords(true) as $word)
146  {
147  $query .= $word;
148  $query .= ' ';
149  }
150  $query .= "') ";
151  }
152  return $query;
153  }
154 }
155 ?>