/** * indexAction * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function indexAction() { $this->core->logger->debug('website->controllers->SearchController->indexAction()'); $request = $this->getRequest(); $strSearchValue = $request->getParam('q'); $intRootLevelId = $request->getParam('rootLevelId'); $this->intLanguageId = $this->core->intLanguageId; $this->strLanguageCode = $this->core->strLanguageCode; /** * set for output */ $this->view->strLanguageCode = $this->strLanguageCode; /** * set up zoolu translate obj */ if (file_exists(GLOBAL_ROOT_PATH . 'application/website/default/language/website-' . $this->strLanguageCode . '.mo')) { $this->translate = new HtmlTranslate('gettext', GLOBAL_ROOT_PATH . 'application/website/default/language/website-' . $this->strLanguageCode . '.mo'); } else { $this->translate = new HtmlTranslate('gettext', GLOBAL_ROOT_PATH . 'application/website/default/language/website-' . $this->core->sysConfig->languages->default->code . '.mo'); } $this->view->translate = $this->translate; $objSearch = new Search(); $objSearch->setSearchValue($strSearchValue); $objSearch->setLanguageId($this->intLanguageId); $objSearch->setRootLevelId($intRootLevelId); /** * set for output */ $this->view->objHits = $objSearch->search(); $this->view->strSearchValue = $strSearchValue; $this->view->languageCode = $this->strLanguageCode; $this->view->rootLevelId = $intRootLevelId; $this->view->setScriptPath(GLOBAL_ROOT_PATH . 'public/website/themes/' . $request->getParam('theme') . '/'); $this->renderScript('search.php'); }
/** * getUserLabels Helper * * @param array $data * @param function $callback * @return mixed */ static function getUserLabels(array $data, $callback = false) { // validate data parameters if (!isset($data['website'])) { throw new \InvalidArgumentException('website is required.'); } // validate data parameters if (!isset($data['search'])) { throw new \InvalidArgumentException('search is required.'); } $woopra_labels = Woopra::getAllLabels($data); $search = new Search($data); $rsp = $search->search(array('website' => $data['website'], 'search' => $data['search'])); $labels = array(); foreach ($rsp->visitors as $visitor) { foreach ($visitor->labels as $label) { if (array_key_exists($label, $woopra_labels)) { $labels[$label] = $woopra_labels[$label]; } } } // run callback or return the label data if (is_callable($callback)) { $callback($labels); } else { return $labels; } }
/** * Perform next scroll search * @throws \Elastica\Exception\InvalidException */ protected function _scroll() { $this->_search->setOption(Search::OPTION_SEARCH_TYPE, Search::OPTION_SEARCH_TYPE_SCROLL); $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_nextScrollId); $resultSet = $this->_search->search(); $this->_currentResultSet = $resultSet; $this->_setScrollId($resultSet); }
public function extendedSearch() { $search = new Search(); $form = $this->template->addSubtemplate('extendedSearch'); $search->assignExtendedToForm($form); $result = $search->search(); if ($result) { $this->showSearchResult($result); } }
/** * Initial scroll search. * * @link http://php.net/manual/en/iterator.rewind.php */ public function rewind() { // reset state $this->_nextScrollId = null; $this->_options = [null, null, null]; // initial search $this->_saveOptions(); $this->_search->setOption(Search::OPTION_SCROLL, $this->expiryTime); $this->_search->setOption(Search::OPTION_SCROLL_ID, null); $this->_setScrollId($this->_search->search()); $this->_revertOptions(); }
public function content() { echo '<div id="thumbnails">'; // generate a basic newest search with a range from 0 to 12 $s = new Search(); $s->order(SORT_NEWEST); $s->range(0, 12); $res = $s->search(); while ($image = $res->fetch_object()) { echo $this->imageBlock($image); } echo '</div><div id="modal"></div><div id="modalContent"> </div>'; }
<body> <div id="dialog"> <div class='content'></div> </div> <div id="menu"><h2>iZwei</h2> <?php echo $site->form(FORM_SIMPLESEARCH); echo $site->form(FORM_UPLOAD); ?> </div> <div id="content"> <?php // will be moved to design later on $s = new Search(); $s->order(SORT_NEWEST); $s->range(0, 12); $res = $s->search(); while ($image = $res->fetch_object()) { echo $site->imageBlock($image); } ?> </div> <div id="modal"> </div> <div id="modalContent"> </div> </body> <?php $site->footer();
function search($apiKey, $type, $query) { // $this->checkApiKey($apiKey); $search = new Search(); $search->search($type, $query); }
case 'best': $o = SORT_POPULARITY; break; case 'worst': $o = SORT_IMPOPULARITY; break; case 'random': $o = SORT_RANDOM; break; default: trigger_error("Sort mode {$o} is not supported!", E_USER_NOTICE); } } $s->order($orders); } $result = $s->search(); $images = array(); while ($image = $result->fetch_assoc()) { $images[] = $image; } echo json_encode($images); break; /** * Get the tags of an image * * @param image valid image id */ /** * Get the tags of an image * * @param image valid image id
//模糊搜索接口 error_reporting(0); require_once '../../models/Response.php'; require_once '../..//models/search.php'; require_once '../../models/UserLike.php'; //require_once 'admin/itemImport.php'; $style = new Response(); if ($_GET['key'] && !$_GET['type']) { $data = array(); $uid = isset($_GET['uid']) ? $_GET['uid'] : null; $page = isset($_GET['page']) ? $_GET['page'] : 1; $n = isset($_GET['limit']) ? $_GET['limit'] : null; $search = new Search(); $like = new UserLikeModel(); $re = $search->search($_GET['key'], $page, $uid, $n); while ($line = mysql_fetch_array($re, MYSQL_ASSOC)) { $line['islike'] = $like->checkUserLike($uid, $line['id']); $line['likesum'] = $like->itemLikeSum($line['id']); $data[] = $line; } echo $style->show(200, $data); } elseif ($_GET['key'] && $_GET['type']) { $data = array(); $uid = isset($_GET['uid']) ? $_GET['uid'] : null; $page = isset($_GET['page']) ? $_GET['page'] : 1; if (isset($_GET['type'])) { $type = type($_GET['type']); } $search = new Search(); $like = new UserLikeModel();
public function exists() { $results = \Search::search('name', $this->lodge['property']['name'])->get(); return !empty($results); }
require_once 'core/init.php'; $user = new User(); if (!$user->isLoggedIn()) { Redirect::to('index.php'); } if (Input::exists('get')) { $fields = array('username' => Input::get('username'), 'firstName' => Input::get('firstName'), 'middleName' => Input::get('middleName'), 'lastName' => Input::get('lastName')); $search = new Search(); $input = false; foreach ($fields as $field => $value) { if (!empty($value)) { $input = true; } } if ($input) { if ($search->search($fields)) { $results = $search->results(); } } } ?> <!DOCTYPE html> <html> <head> <title>Search</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <?php include 'includes/header.php';
<th class="text-right">Release Date</th> <th class="text-right">Tickets Sold</th> <th class="text-right">Gross Revenue</th> </tr> </thead> <tbody> <?php require_once 'connection.php'; require_once 'models/movie-model.php'; $con = getConnection(); $moviemodel = new Search($con); //$q = $_GET['q']; //$matches = $moviemodel->getDetail($q); $q = $_GET['title']; $matches = $moviemodel->search($q); //print_r($matches); foreach ($matches as $row) { ?> <tr> <td><a href="views/detail.php?q=<?php echo $row['ID']; ?> "><?php echo $row['title']; ?> </td> <td><?php echo $row['released']; ?> </td>