<commit_before><?php

class KalturaCriteria extends Criteria
{
	/**
	 * The count of total returned items
	 * @var int
	 */
	protected $recordsCount = 0;
	
	/**
	 * @var array<baseObjectFilter>
	 */
	protected $filters = array();
		
	/**
	 * Execute count query after apply filters 
	 * @var bool
	 */
	protected $doCount = true;
	
	/**
	 * @return int $recordsCount
	 */
	public function getRecordsCount() 
	{
		return $this->recordsCount;
	}
	
	/**
	 * @param int $recordsCount
	 */
	public function setRecordsCount($recordsCount) 
	{
		$this->recordsCount = $recordsCount;
	}
	
	public function dontCount() 
	{
		$this->doCount = false;
	}
	
	/**
	 * Store the filter as is
	 * Later the filter fields and the advanced search will be used to attach additional criterions
	 * 
	 * @param baseObjectFilter $filter
	 */
	public function attachFilter(baseObjectFilter $filter)
	{
		$this->filters[] = $filter;
	}
	
	/**
	 * Applies all filter on this criteria
	 */
	public function applyFilters()
	{
		foreach($this->filters as $filter)
			$filter->attachToFinalCriteria($this);
	}
	
	/**
	 * Creates a new KalturaCriteria for the given object name
	 * 
	 * @param string $objectType object type to create Criteria for.
	 * @return KalturaCriteria derived object
	 */
	public static function create($objectType)
	{
		$searchPluginName = kConf::get("search_plugin");
		
		$searchPlugin = KalturaPluginManager::getPluginInstance($searchPluginName);
			
		$criteriaFactory = $searchPlugin->getInstance('IKalturaCriteriaFactory');
		if (!$criteriaFactory)
		{
			KalturaLog::err("KalturaCriteria IKalturaCriteriaFactory not found for [$searchPluginName] plugin");
			die;
		}
			
		return $criteriaFactory->getKalturaCriteria($objectType);
	}
}<commit_msg>die if no search engine found<commit_after><?php

class KalturaCriteria extends Criteria
{
	/**
	 * The count of total returned items
	 * @var int
	 */
	protected $recordsCount = 0;
	
	/**
	 * @var array<baseObjectFilter>
	 */
	protected $filters = array();
		
	/**
	 * Execute count query after apply filters 
	 * @var bool
	 */
	protected $doCount = true;
	
	/**
	 * @return int $recordsCount
	 */
	public function getRecordsCount() 
	{
		return $this->recordsCount;
	}
	
	/**
	 * @param int $recordsCount
	 */
	public function setRecordsCount($recordsCount) 
	{
		$this->recordsCount = $recordsCount;
	}
	
	public function dontCount() 
	{
		$this->doCount = false;
	}
	
	/**
	 * Store the filter as is
	 * Later the filter fields and the advanced search will be used to attach additional criterions
	 * 
	 * @param baseObjectFilter $filter
	 */
	public function attachFilter(baseObjectFilter $filter)
	{
		$this->filters[] = $filter;
	}
	
	/**
	 * Applies all filter on this criteria
	 */
	public function applyFilters()
	{
		foreach($this->filters as $filter)
			$filter->attachToFinalCriteria($this);
	}
	
	/**
	 * Creates a new KalturaCriteria for the given object name
	 * 
	 * @param string $objectType object type to create Criteria for.
	 * @return KalturaCriteria derived object
	 */
	public static function create($objectType)
	{
		$searchPluginName = kConf::get("search_plugin");
		
		$searchPlugin = KalturaPluginManager::getPluginInstance($searchPluginName);
		if (!$searchPlugin)
		{
			KalturaLog::err("KalturaCriteria search plugin not found [$searchPluginName]");
			die;
		}
			
		$criteriaFactory = $searchPlugin->getInstance('IKalturaCriteriaFactory');
		if (!$criteriaFactory)
		{
			KalturaLog::err("KalturaCriteria IKalturaCriteriaFactory not found for [$searchPluginName] plugin");
			die;
		}
			
		return $criteriaFactory->getKalturaCriteria($objectType);
	}
}
{'fraction_non_alphanumeric': 0.1110236220472441, 'fraction_numerical': 0.0005249343832020997, 'mean_word_length': 3.0978494623655912, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '936149', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1095, 'n_words': 292}