Mage_CatalogSearch_Model_Fulltext Class Reference

Inheritance diagram for Mage_CatalogSearch_Model_Fulltext:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 rebuildIndex ($storeId=null, $productId=null)
 cleanIndex ($storeId=null, $productId=null)
 resetSearchResults ()
 prepareResult ($query=null)
 getSearchType ($storeId=null)

Public Attributes

const SEARCH_TYPE_LIKE = 1
const SEARCH_TYPE_FULLTEXT = 2
const SEARCH_TYPE_COMBINE = 3
const XML_PATH_CATALOG_SEARCH_TYPE = 'catalog/search/search_type'

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 34 of file Fulltext.php.


Member Function Documentation

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 41 of file Fulltext.php.

00042     {
00043         $this->_init('catalogsearch/fulltext');
00044     }

cleanIndex ( storeId = null,
productId = null 
)

Delete index data

Examples: (null, null) => Clean index of all stores (1, null) => Clean index of store Id=1 (1, 2) => Clean index of product Id=2 and its store view Id=1 (null, 2) => Clean index of all store views of product Id=2

Parameters:
int $storeId Store View Id
int $productId Product Entity Id
Returns:
Mage_CatalogSearch_Model_Fulltext

Definition at line 78 of file Fulltext.php.

00079     {
00080         $this->getResource()->cleanIndex($storeId, $productId);
00081         return $this;
00082     }

getSearchType ( storeId = null  ) 

Retrieve search type

Parameters:
int $storeId
Returns:
int

Definition at line 120 of file Fulltext.php.

00121     {
00122         return Mage::getStoreConfig(self::XML_PATH_CATALOG_SEARCH_TYPE, $storeId);
00123     }

prepareResult ( query = null  ) 

Prepare results for query

Parameters:
Mage_CatalogSearch_Model_Query $query
Returns:
Mage_CatalogSearch_Model_Fulltext

Definition at line 101 of file Fulltext.php.

00102     {
00103         if (!$query instanceof Mage_CatalogSearch_Model_Query) {
00104             $query = Mage::helper('catalogSearch')->getQuery();
00105         }
00106         $queryText = Mage::helper('catalogSearch')->getQueryText();
00107         if ($query->getSynonimFor()) {
00108             $queryText = $query->getSynonimFor();
00109         }
00110         $this->getResource()->prepareResult($this, $queryText, $query);
00111         return $this;
00112     }

rebuildIndex ( storeId = null,
productId = null 
)

Regenerate all Stores index

Examples: (null, null) => Regenerate index for all stores (1, null) => Regenerate index for store Id=1 (1, 2) => Regenerate index for product Id=2 and its store view Id=1 (null, 2) => Regenerate index for all store views of product Id=2

Parameters:
int $storeId Store View Id
int $productId Product Entity Id
Returns:
Mage_CatalogSearch_Model_Fulltext

Definition at line 59 of file Fulltext.php.

00060     {
00061         $this->getResource()->rebuildIndex($storeId, $productId);
00062         return $this;
00063     }

resetSearchResults (  ) 

Reset search results cache

Returns:
Mage_CatalogSearch_Model_Fulltext

Definition at line 89 of file Fulltext.php.

00090     {
00091         $this->getResource()->resetSearchResults();
00092         return $this;
00093     }


Member Data Documentation

Definition at line 38 of file Fulltext.php.

Definition at line 37 of file Fulltext.php.

const SEARCH_TYPE_LIKE = 1

Definition at line 36 of file Fulltext.php.

const XML_PATH_CATALOG_SEARCH_TYPE = 'catalog/search/search_type'

Definition at line 39 of file Fulltext.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:49 2009 for Magento by  doxygen 1.5.8