4
0

SearchTest.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <?php
  2. declare(strict_types=1);
  3. require_once(LIB_PATH . '/lib_date.php');
  4. class SearchTest extends PHPUnit\Framework\TestCase {
  5. /**
  6. * @dataProvider provideEmptyInput
  7. */
  8. public function test__construct_whenInputIsEmpty_getsOnlyNullValues(string $input): void {
  9. $search = new FreshRSS_Search($input);
  10. self::assertEquals('', $search->getRawInput());
  11. self::assertNull($search->getIntitle());
  12. self::assertNull($search->getMinDate());
  13. self::assertNull($search->getMaxDate());
  14. self::assertNull($search->getMinPubdate());
  15. self::assertNull($search->getMaxPubdate());
  16. self::assertNull($search->getAuthor());
  17. self::assertNull($search->getTags());
  18. self::assertNull($search->getSearch());
  19. }
  20. /**
  21. * Return an array of values for the search object.
  22. * Here is the description of the values
  23. * @return array{array{''},array{' '}}
  24. */
  25. public function provideEmptyInput(): array {
  26. return [
  27. [''],
  28. [' '],
  29. ];
  30. }
  31. /**
  32. * @dataProvider provideIntitleSearch
  33. * @param array<string>|null $intitle_value
  34. * @param array<string>|null $search_value
  35. */
  36. public function test__construct_whenInputContainsIntitle_setsIntitleProperty(string $input, ?array $intitle_value, ?array $search_value): void {
  37. $search = new FreshRSS_Search($input);
  38. self::assertEquals($intitle_value, $search->getIntitle());
  39. self::assertEquals($search_value, $search->getSearch());
  40. }
  41. /**
  42. * @return array<array<mixed>>
  43. */
  44. public function provideIntitleSearch(): array {
  45. return [
  46. ['intitle:word1', ['word1'], null],
  47. ['intitle:word1-word2', ['word1-word2'], null],
  48. ['intitle:word1 word2', ['word1'], ['word2']],
  49. ['intitle:"word1 word2"', ['word1 word2'], null],
  50. ["intitle:'word1 word2'", ['word1 word2'], null],
  51. ['word1 intitle:word2', ['word2'], ['word1']],
  52. ['word1 intitle:word2 word3', ['word2'], ['word1', 'word3']],
  53. ['word1 intitle:"word2 word3"', ['word2 word3'], ['word1']],
  54. ["word1 intitle:'word2 word3'", ['word2 word3'], ['word1']],
  55. ['intitle:word1 intitle:word2', ['word1', 'word2'], null],
  56. ['intitle: word1 word2', null, ['word1', 'word2']],
  57. ['intitle:123', ['123'], null],
  58. ['intitle:"word1 word2" word3"', ['word1 word2'], ['word3"']],
  59. ["intitle:'word1 word2' word3'", ['word1 word2'], ["word3'"]],
  60. ['intitle:"word1 word2\' word3"', ["word1 word2' word3"], null],
  61. ["intitle:'word1 word2\" word3'", ['word1 word2" word3'], null],
  62. ["intitle:word1 'word2 word3' word4", ['word1'], ['word2 word3', 'word4']],
  63. ['intitle:word1+word2', ['word1+word2'], null],
  64. ];
  65. }
  66. /**
  67. * @dataProvider provideAuthorSearch
  68. * @param array<string>|null $author_value
  69. * @param array<string>|null $search_value
  70. */
  71. public function test__construct_whenInputContainsAuthor_setsAuthorValue(string $input, ?array $author_value, ?array $search_value): void {
  72. $search = new FreshRSS_Search($input);
  73. self::assertEquals($author_value, $search->getAuthor());
  74. self::assertEquals($search_value, $search->getSearch());
  75. }
  76. /**
  77. * @return array<array<mixed>>
  78. */
  79. public function provideAuthorSearch(): array {
  80. return [
  81. ['author:word1', ['word1'], null],
  82. ['author:word1-word2', ['word1-word2'], null],
  83. ['author:word1 word2', ['word1'], ['word2']],
  84. ['author:"word1 word2"', ['word1 word2'], null],
  85. ["author:'word1 word2'", ['word1 word2'], null],
  86. ['word1 author:word2', ['word2'], ['word1']],
  87. ['word1 author:word2 word3', ['word2'], ['word1', 'word3']],
  88. ['word1 author:"word2 word3"', ['word2 word3'], ['word1']],
  89. ["word1 author:'word2 word3'", ['word2 word3'], ['word1']],
  90. ['author:word1 author:word2', ['word1', 'word2'], null],
  91. ['author: word1 word2', null, ['word1', 'word2']],
  92. ['author:123', ['123'], null],
  93. ['author:"word1 word2" word3"', ['word1 word2'], ['word3"']],
  94. ["author:'word1 word2' word3'", ['word1 word2'], ["word3'"]],
  95. ['author:"word1 word2\' word3"', ["word1 word2' word3"], null],
  96. ["author:'word1 word2\" word3'", ['word1 word2" word3'], null],
  97. ["author:word1 'word2 word3' word4", ['word1'], ['word2 word3', 'word4']],
  98. ['author:word1+word2', ['word1+word2'], null],
  99. ];
  100. }
  101. /**
  102. * @dataProvider provideInurlSearch
  103. * @param array<string>|null $inurl_value
  104. * @param array<string>|null $search_value
  105. */
  106. public function test__construct_whenInputContainsInurl_setsInurlValue(string $input, ?array $inurl_value, ?array $search_value): void {
  107. $search = new FreshRSS_Search($input);
  108. self::assertEquals($inurl_value, $search->getInurl());
  109. self::assertEquals($search_value, $search->getSearch());
  110. }
  111. /**
  112. * @return array<array<mixed>>
  113. */
  114. public function provideInurlSearch(): array {
  115. return [
  116. ['inurl:word1', ['word1'], null],
  117. ['inurl: word1', [], ['word1']],
  118. ['inurl:123', ['123'], null],
  119. ['inurl:word1 word2', ['word1'], ['word2']],
  120. ['inurl:"word1 word2"', ['"word1'], ['word2"']],
  121. ['inurl:word1 word2 inurl:word3', ['word1', 'word3'], ['word2']],
  122. ["inurl:word1 'word2 word3' word4", ['word1'], ['word2 word3', 'word4']],
  123. ['inurl:word1+word2', ['word1+word2'], null],
  124. ];
  125. }
  126. /**
  127. * @dataProvider provideDateSearch
  128. */
  129. public function test__construct_whenInputContainsDate_setsDateValues(string $input, ?int $min_date_value, ?int $max_date_value): void {
  130. $search = new FreshRSS_Search($input);
  131. self::assertEquals($min_date_value, $search->getMinDate());
  132. self::assertEquals($max_date_value, $search->getMaxDate());
  133. }
  134. /**
  135. * @return array<array<mixed>>
  136. */
  137. public function provideDateSearch(): array {
  138. return array(
  139. array('date:2007-03-01T13:00:00Z/2008-05-11T15:30:00Z', 1172754000, 1210519800),
  140. array('date:2007-03-01T13:00:00Z/P1Y2M10DT2H30M', 1172754000, 1210519799),
  141. array('date:P1Y2M10DT2H30M/2008-05-11T15:30:00Z', 1172754001, 1210519800),
  142. array('date:2007-03-01/2008-05-11', strtotime('2007-03-01'), strtotime('2008-05-12') - 1),
  143. array('date:2007-03-01/', strtotime('2007-03-01'), null),
  144. array('date:/2008-05-11', null, strtotime('2008-05-12') - 1),
  145. );
  146. }
  147. /**
  148. * @dataProvider providePubdateSearch
  149. */
  150. public function test__construct_whenInputContainsPubdate_setsPubdateValues(string $input, ?int $min_pubdate_value, ?int $max_pubdate_value): void {
  151. $search = new FreshRSS_Search($input);
  152. self::assertEquals($min_pubdate_value, $search->getMinPubdate());
  153. self::assertEquals($max_pubdate_value, $search->getMaxPubdate());
  154. }
  155. /**
  156. * @return array<array<mixed>>
  157. */
  158. public function providePubdateSearch(): array {
  159. return array(
  160. array('pubdate:2007-03-01T13:00:00Z/2008-05-11T15:30:00Z', 1172754000, 1210519800),
  161. array('pubdate:2007-03-01T13:00:00Z/P1Y2M10DT2H30M', 1172754000, 1210519799),
  162. array('pubdate:P1Y2M10DT2H30M/2008-05-11T15:30:00Z', 1172754001, 1210519800),
  163. array('pubdate:2007-03-01/2008-05-11', strtotime('2007-03-01'), strtotime('2008-05-12') - 1),
  164. array('pubdate:2007-03-01/', strtotime('2007-03-01'), null),
  165. array('pubdate:/2008-05-11', null, strtotime('2008-05-12') - 1),
  166. );
  167. }
  168. /**
  169. * @dataProvider provideTagsSearch
  170. * @param array<string>|null $tags_value
  171. * @param array<string>|null $search_value
  172. */
  173. public function test__construct_whenInputContainsTags_setsTagsValue(string $input, ?array $tags_value, ?array $search_value): void {
  174. $search = new FreshRSS_Search($input);
  175. self::assertEquals($tags_value, $search->getTags());
  176. self::assertEquals($search_value, $search->getSearch());
  177. }
  178. /**
  179. * @return array<array<string|array<string>|null>>
  180. */
  181. public function provideTagsSearch(): array {
  182. return [
  183. ['#word1', ['word1'], null],
  184. ['# word1', null, ['#', 'word1']],
  185. ['#123', ['123'], null],
  186. ['#word1 word2', ['word1'], ['word2']],
  187. ['#"word1 word2"', ['"word1'], ['word2"'],],
  188. ['#word1 #word2', ['word1', 'word2'], null],
  189. ["#word1 'word2 word3' word4", ['word1'], ['word2 word3', 'word4']],
  190. ['#word1+word2', ['word1 word2'], null]
  191. ];
  192. }
  193. /**
  194. * @dataProvider provideMultipleSearch
  195. * @param array<string>|null $author_value
  196. * @param array<string> $intitle_value
  197. * @param array<string>|null $inurl_value
  198. * @param array<string>|null $tags_value
  199. * @param array<string>|null $search_value
  200. */
  201. public function test__construct_whenInputContainsMultipleKeywords_setsValues(string $input, ?array $author_value, ?int $min_date_value,
  202. ?int $max_date_value, ?array $intitle_value, ?array $inurl_value, ?int $min_pubdate_value,
  203. ?int $max_pubdate_value, ?array $tags_value, ?array $search_value): void {
  204. $search = new FreshRSS_Search($input);
  205. self::assertEquals($author_value, $search->getAuthor());
  206. self::assertEquals($min_date_value, $search->getMinDate());
  207. self::assertEquals($max_date_value, $search->getMaxDate());
  208. self::assertEquals($intitle_value, $search->getIntitle());
  209. self::assertEquals($inurl_value, $search->getInurl());
  210. self::assertEquals($min_pubdate_value, $search->getMinPubdate());
  211. self::assertEquals($max_pubdate_value, $search->getMaxPubdate());
  212. self::assertEquals($tags_value, $search->getTags());
  213. self::assertEquals($search_value, $search->getSearch());
  214. self::assertEquals($input, $search->getRawInput());
  215. }
  216. /** @return array<array<mixed>> */
  217. public function provideMultipleSearch(): array {
  218. return array(
  219. array(
  220. 'author:word1 date:2007-03-01/2008-05-11 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 #word5',
  221. array('word1'),
  222. strtotime('2007-03-01'),
  223. strtotime('2008-05-12') - 1,
  224. array('word2'),
  225. array('word3'),
  226. strtotime('2007-03-01'),
  227. strtotime('2008-05-12') - 1,
  228. array('word4', 'word5'),
  229. null,
  230. ),
  231. array(
  232. 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 date:2007-03-01/2008-05-11',
  233. array('word1'),
  234. strtotime('2007-03-01'),
  235. strtotime('2008-05-12') - 1,
  236. array('word2'),
  237. array('word3'),
  238. strtotime('2007-03-01'),
  239. strtotime('2008-05-12') - 1,
  240. array('word4', 'word5'),
  241. array('word6'),
  242. ),
  243. array(
  244. 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 word7 date:2007-03-01/2008-05-11',
  245. array('word1'),
  246. strtotime('2007-03-01'),
  247. strtotime('2008-05-12') - 1,
  248. array('word2'),
  249. array('word3'),
  250. strtotime('2007-03-01'),
  251. strtotime('2008-05-12') - 1,
  252. array('word4', 'word5'),
  253. array('word6', 'word7'),
  254. ),
  255. array(
  256. 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 "word7 word8" date:2007-03-01/2008-05-11',
  257. array('word1'),
  258. strtotime('2007-03-01'),
  259. strtotime('2008-05-12') - 1,
  260. array('word2'),
  261. array('word3'),
  262. strtotime('2007-03-01'),
  263. strtotime('2008-05-12') - 1,
  264. array('word4', 'word5'),
  265. array('word7 word8', 'word6'),
  266. ),
  267. );
  268. }
  269. /**
  270. * @dataProvider provideAddOrParentheses
  271. */
  272. public function test__addOrParentheses(string $input, string $output): void {
  273. self::assertEquals($output, FreshRSS_BooleanSearch::addOrParentheses($input));
  274. }
  275. /** @return array<array{string,string}> */
  276. public function provideAddOrParentheses(): array {
  277. return [
  278. ['ab', 'ab'],
  279. ['ab cd', 'ab cd'],
  280. ['!ab -cd', '!ab -cd'],
  281. ['ab OR cd', '(ab) OR (cd)'],
  282. ['!ab OR -cd', '(!ab) OR (-cd)'],
  283. ['ab cd OR ef OR "gh ij"', '(ab cd) OR (ef) OR ("gh ij")'],
  284. ['ab (!cd)', 'ab (!cd)'],
  285. ];
  286. }
  287. /**
  288. * @dataProvider provideconsistentOrParentheses
  289. */
  290. public function test__consistentOrParentheses(string $input, string $output): void {
  291. self::assertEquals($output, FreshRSS_BooleanSearch::consistentOrParentheses($input));
  292. }
  293. /** @return array<array{string,string}> */
  294. public function provideconsistentOrParentheses(): array {
  295. return [
  296. ['ab cd ef', 'ab cd ef'],
  297. ['(ab cd ef)', '(ab cd ef)'],
  298. ['("ab cd" ef)', '("ab cd" ef)'],
  299. ['"ab cd" (ef gh) "ij kl"', '"ab cd" (ef gh) "ij kl"'],
  300. ['ab (!cd)', 'ab (!cd)'],
  301. ['ab !(cd)', 'ab !(cd)'],
  302. ['(ab) -(cd)', '(ab) -(cd)'],
  303. ['ab cd OR ef OR "gh ij"', 'ab cd OR ef OR "gh ij"'],
  304. ['"plain or text" OR (cd)', '("plain or text") OR (cd)'],
  305. ['(ab) OR cd OR ef OR (gh)', '(ab) OR (cd) OR (ef) OR (gh)'],
  306. ['(ab (cd OR ef)) OR gh OR ij OR (kl)', '(ab (cd OR ef)) OR (gh) OR (ij) OR (kl)'],
  307. ['(ab (cd OR ef OR (gh))) OR ij', '(ab ((cd) OR (ef) OR (gh))) OR (ij)'],
  308. ['(ab (!cd OR ef OR (gh))) OR ij', '(ab ((!cd) OR (ef) OR (gh))) OR (ij)'],
  309. ['(ab !(cd OR ef OR !(gh))) OR ij', '(ab !((cd) OR (ef) OR !(gh))) OR (ij)'],
  310. ];
  311. }
  312. /**
  313. * @dataProvider provideParentheses
  314. * @param array<string> $values
  315. */
  316. public function test__parentheses(string $input, string $sql, array $values): void {
  317. [$filterValues, $filterSearch] = FreshRSS_EntryDAOPGSQL::sqlBooleanSearch('e.', new FreshRSS_BooleanSearch($input));
  318. self::assertEquals(trim($sql), trim($filterSearch));
  319. self::assertEquals($values, $filterValues);
  320. }
  321. /** @return array<array<mixed>> */
  322. public function provideParentheses(): array {
  323. return [
  324. [
  325. 'f:1 (f:2 OR f:3 OR f:4) (f:5 OR (f:6 OR f:7))',
  326. ' ((e.id_feed IN (?) )) AND ((e.id_feed IN (?) ) OR (e.id_feed IN (?) ) OR (e.id_feed IN (?) )) AND' .
  327. ' (((e.id_feed IN (?) )) OR ((e.id_feed IN (?) ) OR (e.id_feed IN (?) ))) ',
  328. ['1', '2', '3', '4', '5', '6', '7']
  329. ],
  330. [
  331. '#tag Hello OR (author:Alice inurl:example) OR (f:3 intitle:World) OR L:12',
  332. " ((TRIM(e.tags) || ' #' LIKE ? AND (e.title LIKE ? OR e.content LIKE ?) )) OR ((e.author LIKE ? AND e.link LIKE ? )) OR" .
  333. ' ((e.id_feed IN (?) AND e.title LIKE ? )) OR ((e.id IN (SELECT et.id_entry FROM `_entrytag` et WHERE et.id_tag IN (?)) )) ',
  334. ['%tag #%','%Hello%', '%Hello%', '%Alice%', '%example%', '3', '%World%', '12']
  335. ],
  336. [
  337. '#tag Hello (author:Alice inurl:example) (f:3 intitle:World) label:Bleu',
  338. " ((TRIM(e.tags) || ' #' LIKE ? AND (e.title LIKE ? OR e.content LIKE ?) )) AND" .
  339. ' ((e.author LIKE ? AND e.link LIKE ? )) AND' .
  340. ' ((e.id_feed IN (?) AND e.title LIKE ? )) AND' .
  341. ' ((e.id IN (SELECT et.id_entry FROM `_entrytag` et, `_tag` t WHERE et.id_tag = t.id AND t.name IN (?)) )) ',
  342. ['%tag #%', '%Hello%', '%Hello%', '%Alice%', '%example%', '3', '%World%', 'Bleu']
  343. ],
  344. [
  345. '!((author:Alice intitle:hello) OR (author:Bob intitle:world))',
  346. ' NOT (((e.author LIKE ? AND e.title LIKE ? )) OR ((e.author LIKE ? AND e.title LIKE ? ))) ',
  347. ['%Alice%', '%hello%', '%Bob%', '%world%'],
  348. ],
  349. [
  350. '(author:Alice intitle:hello) !(author:Bob intitle:world)',
  351. ' ((e.author LIKE ? AND e.title LIKE ? )) AND NOT ((e.author LIKE ? AND e.title LIKE ? )) ',
  352. ['%Alice%', '%hello%', '%Bob%', '%world%'],
  353. ],
  354. [
  355. 'intitle:"\\(test\\)"',
  356. '(e.title LIKE ? )',
  357. ['%(test)%'],
  358. ],
  359. [
  360. 'intitle:\'"hello world"\'',
  361. '(e.title LIKE ? )',
  362. ['%"hello world"%'],
  363. ],
  364. [
  365. '(ab) OR (cd) OR (ef)',
  366. '(((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) ))',
  367. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  368. ],
  369. [
  370. '("plain or text") OR (cd)',
  371. '(((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) ))',
  372. ['%plain or text%', '%plain or text%', '%cd%', '%cd%'],
  373. ],
  374. [
  375. '"plain or text" OR cd',
  376. '((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) )',
  377. ['%plain or text%', '%plain or text%', '%cd%', '%cd%'],
  378. ],
  379. [
  380. '"plain OR text" OR cd',
  381. '((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ) ',
  382. ['%plain OR text%', '%plain OR text%', '%cd%', '%cd%'],
  383. ],
  384. [
  385. 'ab OR cd OR (ef)',
  386. '(((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) )) ',
  387. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  388. ],
  389. [
  390. 'ab OR cd OR ef',
  391. '((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) )',
  392. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  393. ],
  394. [
  395. '(ab) cd OR ef OR (gh)',
  396. '(((e.title LIKE ? OR e.content LIKE ?) )) AND (((e.title LIKE ? OR e.content LIKE ?) )) ' .
  397. 'OR (((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) ))',
  398. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%gh%'],
  399. ],
  400. [
  401. '(ab) OR cd OR ef OR (gh)',
  402. '(((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) )) ' .
  403. 'OR (((e.title LIKE ? OR e.content LIKE ?) )) OR (((e.title LIKE ? OR e.content LIKE ?) ))',
  404. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%gh%'],
  405. ],
  406. [
  407. 'ab OR (!(cd OR ef))',
  408. '(((e.title LIKE ? OR e.content LIKE ?) )) OR (NOT (((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) )))',
  409. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  410. ],
  411. [
  412. 'ab !(cd OR ef)',
  413. '(((e.title LIKE ? OR e.content LIKE ?) )) AND NOT (((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ))',
  414. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  415. ],
  416. [
  417. 'ab OR !(cd OR ef)',
  418. '(((e.title LIKE ? OR e.content LIKE ?) )) OR NOT (((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ))',
  419. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%'],
  420. ],
  421. [
  422. '(ab (!cd OR ef OR (gh))) OR !(ij OR kl)',
  423. '((((e.title LIKE ? OR e.content LIKE ?) )) AND (((e.title NOT LIKE ? AND e.content NOT LIKE ? )) OR (((e.title LIKE ? OR e.content LIKE ?) )) ' .
  424. 'OR (((e.title LIKE ? OR e.content LIKE ?) )))) OR NOT (((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ))',
  425. ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%gh%', '%ij%', '%ij%', '%kl%', '%kl%'],
  426. ],
  427. ];
  428. }
  429. }