• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/action/searchaction.php
  • Класс: BitrixTasksRestControllersActionSearchAction
  • Вызов: SearchAction::getTasksBySearch
private function getTasksBySearch(string $searchQuery): array
{
	$tasks = $this->getTasksWithSearchInBody($searchQuery);
	if (count($tasks) < $this->maxSearchSize)
	{
		$tasksWithSearchInComments = $this->getTasksWithSearchInComments($searchQuery);
		$tasksWithSearchInComments = $this->clearDuplicates($tasksWithSearchInComments, $tasks);
		$tasksWithSearchInComments = $this->fillMessageIds($tasksWithSearchInComments);

		$tasks = array_merge($tasks, $tasksWithSearchInComments);
	}

	return array_slice($tasks, 0, 20);
}