示例#1
0
文件: file.php 项目: notzen/concrete5
	public function reindex() {
		Loader::model('attribute/categories/file');
		$attribs = FileAttributeKey::getAttributes($this->getFileID(), $this->getFileVersionID(), 'getSearchIndexValue');
		$db = Loader::db();

		$db->Execute('delete from FileSearchIndexAttributes where fID = ?', array($this->getFileID()));
		$searchableAttributes = array('fID' => $this->getFileID());
		$rs = $db->Execute('select * from FileSearchIndexAttributes where fID = -1');
		AttributeKey::reindex('FileSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
	}
示例#2
0
		public function reindex() {
			$attribs = UserAttributeKey::getAttributes($this->getUserID(), 'getSearchIndexValue');
			$db = Loader::db();
	
			$db->Execute('delete from UserSearchIndexAttributes where uID = ?', array($this->getUserID()));
			$searchableAttributes = array('uID' => $this->getUserID());
			$rs = $db->Execute('select * from UserSearchIndexAttributes where uID = -1');
			AttributeKey::reindex('UserSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
		}
示例#3
0
		public function reindex($index = false) {
			if ($this->isAlias()) {
				return false;
			}
			$db = Loader::db();
			
			Loader::model('attribute/categories/collection');
			$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
	
			$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
			$searchableAttributes = array('cID' => $this->getCollectionID());
			$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
			AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
			
			if ($index == false) {
				Loader::library('database_indexed_search');
				$index = new IndexedSearch();
			}
			
			$datetime = Loader::helper('date')->getSystemDateTime();
			
			$db->Replace('PageSearchIndex', array(
				'cID' => $this->getCollectionID(), 
				'cName' => $this->getCollectionName(), 
				'cDescription' => $this->getCollectionDescription(), 
				'cPath' => $this->getCollectionPath(),
				'cDatePublic' => $this->getCollectionDatePublic(), 
				'content' => $index->getBodyContentFromPage($this),
				'cDateLastIndexed' => $datetime
			), array('cID'), true);			
		}
示例#4
0
		public function reindex($index = false, $actuallyDoReindex = true) {
			if ($this->isAlias()) {
				return false;
			}
			if ($actuallyDoReindex || ENABLE_PROGRESSIVE_PAGE_REINDEX == false) { 
				$db = Loader::db();
				
				Loader::model('attribute/categories/collection');
				$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
		
				$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
				$searchableAttributes = array('cID' => $this->getCollectionID());
				$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
				AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
				
				if ($index == false) {
					Loader::library('database_indexed_search');
					$index = new IndexedSearch();
				}
				
				$index->reindexPage($this);
				$db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 0), array('cID'), false);

				$cache = PageCache::getLibrary();
				$cache->purge($this);

			} else { 			
				$db = Loader::db();
				Config::save('DO_PAGE_REINDEX_CHECK', true);
				$db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 1), array('cID'), false);
			}
		}
示例#5
0
		public function reindex($index = false) {
			if ($this->isAlias()) {
				return false;
			}
			$db = Loader::db();
			
			Loader::model('attribute/categories/collection');
			$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
	
			$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
			$searchableAttributes = array('cID' => $this->getCollectionID());
			$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
			AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
			
			if ($index == false) {
				Loader::library('database_indexed_search');
				$index = new IndexedSearch();
			}
			
			$index->reindexPage($this);
		}