<commit_before><?php

/**
 * @author <EMAIL>
 */
class Made_Loop54_Model_Resource_Engine
{
    protected $_adapter;

    /**
     * We only have one adapter right now
     */
    public function __construct()
    {
        $this->_adapter = Mage::getSingleton('made_loop54/adapter_loop54');
    }

    /**
     * Define if selected adapter is available
     *
     * @return bool
     */
    public function test()
    {
        return $this->_adapter->ping();
    }

    /**
     * Retrieve search result data collection
     *
     * @return Made_Loop54_Model_Resource_Collection
     */
    public function getResultCollection()
    {
        return Mage::getResourceModel('made_loop54/collection')->setEngine($this);
    }

    /**
     * Define if Layered Navigation is allowed
     *
     * @deprecated after 1.9.1
     * @see $this->isLayeredNavigationAllowed()
     *
     * @return bool
     */
    public function isLeyeredNavigationAllowed()
    {
        $this->isLayeredNavigationAllowed();
    }

    /**
     * Define if Layered Navigation is allowed
     *
     * @return bool
     */
    public function isLayeredNavigationAllowed()
    {
        return true;
    }

    /**
     * Perform a search query
     *
     * @param $query
     * @param array $params
     * @return array
     */
    public function search($query, $params = array())
    {
        return $this->_adapter->search($query, $params);
    }

    /**
     * We don't control the index at this point, so we just return $this
     *
     * @param null $storeIds
     * @param null $entityIds
     * @param string $entityType
     * @return $this
     */
    public function cleanIndex($storeIds = null, $entityIds = null, $entityType = 'product')
    {
        return $this;
    }

    /**
     * Define if current search engine supports advanced index
     *
     * @return bool
     */
    public function allowAdvancedIndex()
    {
        // Don't really know what this is yet
        return false;
    }

    /**
     * Retrieve allowed visibility values for current engine
     *
     * @return array
     */
    public function getAllowedVisibility()
    {
        return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();
    }

}<commit_msg>compatibility with the index process<commit_after><?php

/**
 * @author <EMAIL>
 */
class Made_Loop54_Model_Resource_Engine
{
    protected $_adapter;

    /**
     * We only have one adapter right now
     */
    public function __construct()
    {
        $this->_adapter = Mage::getSingleton('made_loop54/adapter_loop54');
    }

    /**
     * Define if selected adapter is available
     *
     * @return bool
     */
    public function test()
    {
        return $this->_adapter->ping();
    }

    /**
     * Retrieve search result data collection
     *
     * @return Made_Loop54_Model_Resource_Collection
     */
    public function getResultCollection()
    {
        return Mage::getResourceModel('made_loop54/collection')->setEngine($this);
    }

    /**
     * Define if Layered Navigation is allowed
     *
     * @deprecated after 1.9.1
     * @see $this->isLayeredNavigationAllowed()
     *
     * @return bool
     */
    public function isLeyeredNavigationAllowed()
    {
        $this->isLayeredNavigationAllowed();
    }

    /**
     * Define if Layered Navigation is allowed
     *
     * @return bool
     */
    public function isLayeredNavigationAllowed()
    {
        return true;
    }

    /**
     * Perform a search query
     *
     * @param $query
     * @param array $params
     * @return array
     */
    public function search($query, $params = array())
    {
        return $this->_adapter->search($query, $params);
    }

    /**
     * We don't control the index at this point, so we just return $this
     *
     * @param null $storeIds
     * @param null $entityIds
     * @param string $entityType
     * @return $this
     */
    public function cleanIndex($storeIds = null, $entityIds = null, $entityType = 'product')
    {
        return $this;
    }

    /**
     * Define if current search engine supports advanced index
     *
     * @return bool
     */
    public function allowAdvancedIndex()
    {
        // Don't really know what this is yet
        return false;
    }

    /**
     * Retrieve allowed visibility values for current engine
     *
     * @return array
     */
    public function getAllowedVisibility()
    {
        return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();
    }

    /**
     * Prepare index array
     *
     * @param array $index
     * @param string|null $separator
     * @return array
     */
    public function prepareEntityIndex($index, $separator = null)
    {
        return $index;
    }

    /**
     * Add entity data to search index
     *
     * @param int $entityId
     * @param int $storeId
     * @param array $index
     * @param string $entityType 'product'|'cms'
     *
     * @return Enterprise_Search_Model_Resource_Engine
     */
    public function saveEntityIndex($entityId, $storeId, $index, $entityType = 'product')
    {
        return $this;
    }

    /**
     * Add entities data to search index
     *
     * @param int $storeId
     * @param array $entityIndexes
     * @param string $entityType 'product'|'cms'
     *
     * @return Enterprise_Search_Model_Resource_Engine
     */
    public function saveEntityIndexes($storeId, $entityIndexes, $entityType = 'product')
    {
        return $this;
    }

}
{'fraction_non_alphanumeric': 0.10929853181076672, 'fraction_numerical': 0.004712706180895414, 'mean_word_length': 2.1210407239819005, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '1548460', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1563, 'n_words': 404}