ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLikeMetaDataSearch.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
35include_once 'Services/Search/classes/class.ilMetaDataSearch.php';
36
38{
39
40 // Private
42 {
43 global $DIC;
44
45 $ilDB = $DIC['ilDB'];
46
47 $concat = ' keyword ';
48 $where = " WHERE (";
49 $counter = 0;
50 foreach ($this->query_parser->getQuotedWords() as $word) {
51 if ($counter++) {
52 $where .= "OR";
53 }
54 $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
55 #$where .= $concat;
56 #$where .= (" LIKE ('%".$word."%')");
57 }
58 return $where . ') ';
59 }
60
62 {
63 global $DIC;
64
65 $ilDB = $DIC['ilDB'];
66
67 $concat = ' entity ';
68 $where = " WHERE (";
69 $counter = 0;
70 foreach ($this->query_parser->getQuotedWords() as $word) {
71 if ($counter++) {
72 $where .= "OR";
73 }
74 #$where .= $concat;
75 #$where .= (" LIKE ('%".$word."%')");
76 $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
77 }
78 return $where . ') ';
79 }
81 {
82 global $DIC;
83
84 $ilDB = $DIC['ilDB'];
85
86 /*
87 $concat = ' CONCAT(title,coverage) '; // broken if coverage is null
88 // DONE: fix coverage search
89 $concat = ' title ';
90 */
91
92 $concat = $ilDB->concat(
93 array(
94 array('title','text'),
95 array('coverage','text'))
96 );
97
98
99 $where = " WHERE (";
100 $counter = 0;
101 foreach ($this->query_parser->getQuotedWords() as $word) {
102 if ($counter++) {
103 $where .= "OR";
104 }
105 #$where .= $concat;
106 #$where .= (" LIKE ('%".$word."%')");
107 $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
108 }
109 return $where . ' )';
110 }
111
113 {
114 global $DIC;
115
116 $ilDB = $DIC['ilDB'];
117
118 $concat = ' description ';
119 $where = " WHERE (";
120 $counter = 0;
121 foreach ($this->query_parser->getQuotedWords() as $word) {
122 if ($counter++) {
123 $where .= "OR";
124 }
125 #$where .= $concat;
126 #$where .= (" LIKE ('%".$word."%')");
127 $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
128 }
129 return $where . ') ';
130 }
131}
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
global $ilDB