Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_CatalogSearch_AdvancedController
  • Mage_CatalogSearch_AjaxController
  • Mage_CatalogSearch_Block_Advanced_Form
  • Mage_CatalogSearch_Block_Advanced_Result
  • Mage_CatalogSearch_Block_Autocomplete
  • Mage_CatalogSearch_Block_Layer
  • Mage_CatalogSearch_Block_Layer_Filter_Attribute
  • Mage_CatalogSearch_Block_Result
  • Mage_CatalogSearch_Block_Term
  • Mage_CatalogSearch_Helper_Data
  • Mage_CatalogSearch_Model_Advanced
  • Mage_CatalogSearch_Model_Fulltext
  • Mage_CatalogSearch_Model_Fulltext_Observer
  • Mage_CatalogSearch_Model_Indexer_Fulltext
  • Mage_CatalogSearch_Model_Layer
  • Mage_CatalogSearch_Model_Layer_Filter_Attribute
  • Mage_CatalogSearch_Model_Mysql4_Advanced
  • Mage_CatalogSearch_Model_Mysql4_Advanced_Collection
  • Mage_CatalogSearch_Model_Mysql4_Fulltext
  • Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
  • Mage_CatalogSearch_Model_Mysql4_Fulltext_Engine
  • Mage_CatalogSearch_Model_Mysql4_Indexer_Fulltext
  • Mage_CatalogSearch_Model_Mysql4_Query
  • Mage_CatalogSearch_Model_Mysql4_Query_Collection
  • Mage_CatalogSearch_Model_Mysql4_Search_Collection
  • Mage_CatalogSearch_Model_Query
  • Mage_CatalogSearch_Model_Resource_Advanced
  • Mage_CatalogSearch_Model_Resource_Advanced_Collection
  • Mage_CatalogSearch_Model_Resource_Fulltext
  • Mage_CatalogSearch_Model_Resource_Fulltext_Collection
  • Mage_CatalogSearch_Model_Resource_Fulltext_Engine
  • Mage_CatalogSearch_Model_Resource_Indexer_Fulltext
  • Mage_CatalogSearch_Model_Resource_Query
  • Mage_CatalogSearch_Model_Resource_Query_Collection
  • Mage_CatalogSearch_Model_Resource_Search_Collection
  • Mage_CatalogSearch_Model_Session
  • Mage_Catalogsearch_Model_System_Config_Backend_Sitemap
  • Mage_CatalogSearch_ResultController
  • Mage_CatalogSearch_TermController
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_CatalogSearch
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Catalog advanced search model
 29:  *
 30:  * @method Mage_CatalogSearch_Model_Resource_Fulltext _getResource()
 31:  * @method Mage_CatalogSearch_Model_Resource_Fulltext getResource()
 32:  * @method int getProductId()
 33:  * @method Mage_CatalogSearch_Model_Fulltext setProductId(int $value)
 34:  * @method int getStoreId()
 35:  * @method Mage_CatalogSearch_Model_Fulltext setStoreId(int $value)
 36:  * @method string getDataIndex()
 37:  * @method Mage_CatalogSearch_Model_Fulltext setDataIndex(string $value)
 38:  *
 39:  * @category    Mage
 40:  * @package     Mage_CatalogSearch
 41:  * @author      Magento Core Team <core@magentocommerce.com>
 42:  */
 43: class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract
 44: {
 45:     const SEARCH_TYPE_LIKE              = 1;
 46:     const SEARCH_TYPE_FULLTEXT          = 2;
 47:     const SEARCH_TYPE_COMBINE           = 3;
 48:     const XML_PATH_CATALOG_SEARCH_TYPE  = 'catalog/search/search_type';
 49: 
 50:     /**
 51:      * Whether table changes are allowed
 52:      *
 53:      * @deprecated after 1.6.1.0
 54:      * @var bool
 55:      */
 56:     protected $_allowTableChanges = true;
 57: 
 58:     protected function _construct()
 59:     {
 60:         $this->_init('catalogsearch/fulltext');
 61:     }
 62: 
 63:     /**
 64:      * Regenerate all Stores index
 65:      *
 66:      * Examples:
 67:      * (null, null) => Regenerate index for all stores
 68:      * (1, null)    => Regenerate index for store Id=1
 69:      * (1, 2)       => Regenerate index for product Id=2 and its store view Id=1
 70:      * (null, 2)    => Regenerate index for all store views of product Id=2
 71:      *
 72:      * @param int|null $storeId Store View Id
 73:      * @param int|array|null $productIds Product Entity Id
 74:      *
 75:      * @return Mage_CatalogSearch_Model_Fulltext
 76:      */
 77:     public function rebuildIndex($storeId = null, $productIds = null)
 78:     {
 79:         Mage::dispatchEvent('catalogsearch_index_process_start', array(
 80:             'store_id'      => $storeId,
 81:             'product_ids'   => $productIds
 82:         ));
 83: 
 84:         $this->getResource()->rebuildIndex($storeId, $productIds);
 85: 
 86:         Mage::dispatchEvent('catalogsearch_index_process_complete', array());
 87: 
 88:         return $this;
 89:     }
 90: 
 91:     /**
 92:      * Delete index data
 93:      *
 94:      * Examples:
 95:      * (null, null) => Clean index of all stores
 96:      * (1, null)    => Clean index of store Id=1
 97:      * (1, 2)       => Clean index of product Id=2 and its store view Id=1
 98:      * (null, 2)    => Clean index of all store views of product Id=2
 99:      *
100:      * @param int $storeId Store View Id
101:      * @param int $productId Product Entity Id
102:      * @return Mage_CatalogSearch_Model_Fulltext
103:      */
104:     public function cleanIndex($storeId = null, $productId = null)
105:     {
106:         $this->getResource()->cleanIndex($storeId, $productId);
107:         return $this;
108:     }
109: 
110:     /**
111:      * Reset search results cache
112:      *
113:      * @return Mage_CatalogSearch_Model_Fulltext
114:      */
115:     public function resetSearchResults()
116:     {
117:         $this->getResource()->resetSearchResults();
118:         return $this;
119:     }
120: 
121:     /**
122:      * Prepare results for query
123:      *
124:      * @param Mage_CatalogSearch_Model_Query $query
125:      * @return Mage_CatalogSearch_Model_Fulltext
126:      */
127:     public function prepareResult($query = null)
128:     {
129:         if (!$query instanceof Mage_CatalogSearch_Model_Query) {
130:             $query = Mage::helper('catalogsearch')->getQuery();
131:         }
132:         $queryText = Mage::helper('catalogsearch')->getQueryText();
133:         if ($query->getSynonymFor()) {
134:             $queryText = $query->getSynonymFor();
135:         }
136:         $this->getResource()->prepareResult($this, $queryText, $query);
137:         return $this;
138:     }
139: 
140:     /**
141:      * Retrieve search type
142:      *
143:      * @param int $storeId
144:      * @return int
145:      */
146:     public function getSearchType($storeId = null)
147:     {
148:         return Mage::getStoreConfig(self::XML_PATH_CATALOG_SEARCH_TYPE, $storeId);
149:     }
150: 
151: 
152: 
153: 
154: 
155:     // Deprecated methods
156: 
157:     /**
158:      * Set whether table changes are allowed
159:      *
160:      * @deprecated after 1.6.1.0
161:      *
162:      * @param bool $value
163:      * @return Mage_CatalogSearch_Model_Fulltext
164:      */
165:     public function setAllowTableChanges($value = true)
166:     {
167:         $this->_allowTableChanges = $value;
168:         return $this;
169:     }
170: 
171:     /**
172:      * Update category products indexes
173:      *
174:      * @deprecated after 1.6.2.0
175:      *
176:      * @param array $productIds
177:      * @param array $categoryIds
178:      *
179:      * @return Mage_CatalogSearch_Model_Fulltext
180:      */
181:     public function updateCategoryIndex($productIds, $categoryIds)
182:     {
183:         $this->getResource()->updateCategoryIndex($productIds, $categoryIds);
184:         return $this;
185:     }
186: }
187: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0