Lines Matching full:if
37 if (!$this->lock())
42 if ($pid === false) {
50 if ($words === false) {
55 if (!empty($words)) {
63 if (!$this->saveIndex('i', $wlen, $index)) {
72 if ($pageword_idx !== '') {
77 if ($word != '') {
93 if (!$this->saveIndexKey('pageword', '', $pid, $pageword_idx)) {
121 if (isset($words[$l])) {
136 if ($wid === false) {
141 if (!isset($index[$wlen]))
146 if ($word_idx_modified && !$this->saveIndex('w', $wlen, $word_idx))
159 * not be used if $key is an array.
171 if (!is_array($key)) {
178 if (!$this->lock())
183 if ($pid === false) {
189 if (isset($key['title'])) {
191 if (is_array($value)) {
205 if (!is_array($values)) $values = [$values];
208 if ($val_idx !== '') {
218 if ($val !== "") {
220 if ($id === false) {
227 // test if value is already in the index
228 if (isset($val_idx[$id]) && $val_idx[$id] <= 0) {
236 if ($addwords) {
241 if ($action == -1) {
251 if ($vals_changed) {
266 …a page in the search index without changing the indexed content. This function doesn't check if the
267 …* old or new name exists in the filesystem. It returns an error if the old page isn't in the page …
272 …* @return string|bool If the page was successfully renamed, can be a message in the case of an err…
276 if (!$this->lock()) return 'locked';
281 if ($id === false) {
287 if ($new_id !== false) {
289 if (!$this->deletePageNoLock($newpage)) {
299 if (!$this->saveIndex('page', '', $pages)) {
317 …* @param string $newvalue The new value to which the old value shall be renamed, if exists values…
318 …* @return bool|string If renaming the value has been successful, false or error message on er…
322 if (!$this->lock()) return 'locked';
327 if ($oldid !== false) {
329 if ($newid !== false) {
335 if ($indexline != '') {
347 if (!in_array($newid, $keyline)) {
359 if (!$this->saveIndex($key . '_w', '', $metavalues)) {
382 if (!$this->lock())
393 …* Remove a page from the index without locking the index, only use this function if the index is a…
406 if ($pid === false) {
412 if ($pageword_idx !== '') {
416 if ($word != '') {
431 if (!$this->saveIndexKey('pageword', '', $pid, "")) {
441 if ($id === '') continue;
454 * @return bool If the index has been cleared successfully
460 if (!$this->lock()) return false;
467 if ($dir !== false) {
469 if (
512 if ($evt->advise_before(true)) {
513 if (preg_match('/[^0-9A-Za-z ]/u', $text)) {
524 if (preg_match('/[^0-9A-Za-z ]/u', $text))
534 if (
552 if (isset($this->pidCache[$page])) return $this->pidCache[$page];
554 if (!$this->lock())
559 if ($pid === false) {
578 if (isset($this->pidCache[$page])) return $this->pidCache[$page];
582 if (count($this->pidCache) > 10) array_shift($this->pidCache);
618 if (empty($wids)) return [];
626 if ($ixid < count($index))
637 if (!isset($docs[$wid])) continue;
641 if (!page_exists($hitkey, '', false)) continue;
642 if (!isset($final[$word][$hitkey]))
658 * second argument. The function preg_match can be used directly if the
664 * @return array lists with page names, keys are query values if $value is array
671 if (!is_array($value))
681 if ($key == 'title') {
687 if (!is_null($func)) {
690 if (call_user_func_array($func, [$val, $word]))
700 if (str_starts_with($xval, '*')) {
704 if (str_ends_with($xval, '*')) {
708 if (!$caret || !$dollar) {
729 if ($key == 'title') {
749 if (!is_array($value)) $result = $result[$value];
780 if (str_starts_with($xword, '*')) {
785 if (str_ends_with($xword, '*')) {
790 if ($wlen < IDX_MINWORDLENGTH && $caret && $dollar && !is_numeric($xword))
792 if (!isset($tokens[$xword]))
794 if (!$caret || !$dollar) {
797 if (!isset($tokenwild[$xword]))
809 if ($tokenwild !== []) sort($indexes_known);
815 if (isset($tokenlength[$ixlen])) {
818 if ($wid !== false) {
827 if ($wlen >= $ixlen) break;
829 if (is_null($w[1])) continue;
852 if (is_null($key)) return $page_idx;
857 if ($key == 'title') {
861 if ($title === "") unset($page_idx[$i]);
877 * @param int $max upper frequency limit. No limit if $max<$min
879 * @param string $key metadata key to list. Uses the fulltext index if not given
886 if ($min < 1)
888 if ($max < $min)
893 if ($key == 'title') {
897 if ($cnt >= $min && (!$max || $cnt <= $max) && strlen($val) >= $minlen)
906 if ($freq >= $min && (!$max || $freq <= $max))
909 if ($val_idx !== []) {
912 if (strlen($words[$wid]) >= $minlen)
919 if ($length < $minlen) continue;
924 if ($freq >= $min && (!$max || $freq <= $max)) {
925 if ($words === null)
952 if (is_dir($lock) && time() - @filemtime($lock) > 60 * 5) {
954 if (!@rmdir($lock)) {
965 if ($conf['dperm']) {
1002 if (!file_exists($fn)) return [];
1012 * @return bool If saving succeeded
1021 if (!$fh) return false;
1023 if (!empty($lines))
1026 if ($conf['fperm'])
1046 if (!file_exists($fn)) return '';
1048 if (!$fh) return '';
1051 if (++$ln == $id) break;
1064 * @return bool If saving succeeded
1071 if (!str_ends_with($line, "\n"))
1075 if (!$fh) return false;
1077 if ($ih) {
1082 if ($id > $ln) {
1095 if ($conf['fperm'])
1107 …* @return int|bool line number of the value in the index or false if writing the index fa…
1115 if ($id === false) {
1118 if (!$this->saveIndex($idx, $suffix, $index)) {
1155 if (is_array($filter)) {
1156 // testing if index files exist only
1159 if (file_exists($path . $key . '.idx'))
1166 if ((int)$length >= (int)$filter)
1185 if ($line != '') {
1189 if ($count) {
1190 if ($line) {
1212 if ($line == '') return $result;
1215 if ($tuple === '') continue;
1217 if (!$cnt) continue;
1218 if (isset($keys[$key])) {
1220 if ($key === false || is_null($key)) continue;
1240 if ($tuple === '') continue;