当前位置: 首页>>代码示例>>PHP>>正文


PHP Search::search方法代码示例

本文整理汇总了PHP中Search::search方法的典型用法代码示例。如果您正苦于以下问题:PHP Search::search方法的具体用法?PHP Search::search怎么用?PHP Search::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Search的用法示例。


在下文中一共展示了Search::search方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 /**
  * indexAction
  * @author Cornelius Hansjakob <cha@massiveart.com>
  * @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');
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:40,代码来源:SearchController.php

示例2: getUserLabels

 /**
  * 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;
     }
 }
开发者ID:aamortimer,项目名称:woopra,代码行数:35,代码来源:Woopra.php

示例3: _scroll

 /**
  * 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);
 }
开发者ID:backplane,项目名称:elastica,代码行数:12,代码来源:ScanAndScroll.php

示例4: extendedSearch

 public function extendedSearch()
 {
     $search = new Search();
     $form = $this->template->addSubtemplate('extendedSearch');
     $search->assignExtendedToForm($form);
     $result = $search->search();
     if ($result) {
         $this->showSearchResult($result);
     }
 }
开发者ID:BackupTheBerlios,项目名称:erlassdb,代码行数:10,代码来源:ErlassDB.php

示例5: rewind

 /**
  * 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();
 }
开发者ID:ruflin,项目名称:elastica,代码行数:17,代码来源:Scroll.php

示例6: content

 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>';
 }
开发者ID:nyson,项目名称:izwei,代码行数:13,代码来源:Design.php

示例7: Search

<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();
开发者ID:valderman,项目名称:izwei,代码行数:30,代码来源:index.php

示例8: search

function search($apiKey, $type, $query)
{
    // $this->checkApiKey($apiKey);
    $search = new Search();
    $search->search($type, $query);
}
开发者ID:andreamswick,项目名称:price_check_v2,代码行数:6,代码来源:index.php

示例9: array

                 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
开发者ID:valderman,项目名称:izwei,代码行数:31,代码来源:ajax.php

示例10: Response

//模糊搜索接口
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();
开发者ID:bmchun,项目名称:sunset,代码行数:30,代码来源:search.php

示例11: exists

 public function exists()
 {
     $results = \Search::search('name', $this->lodge['property']['name'])->get();
     return !empty($results);
 }
开发者ID:HammamSamara,项目名称:sosbot,代码行数:5,代码来源:LodgeRepository.php

示例12: User

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';
开发者ID:seanhho28,项目名称:social-network,代码行数:31,代码来源:search.php

示例13: getConnection

                <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>
开发者ID:EricRiney,项目名称:LAMP-Server,代码行数:31,代码来源:index.php


注:本文中的Search::search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。