Search for result to the keywords.
@param string $keyword
323941
public function search($keyword = "")
    {
        Yii::trace("Begin searching...", __METHOD__);
        $matches = $this->match($keyword);
        $results = [];
        foreach ($matches as $extension) {
            $results[$extension->extension->id()] = $extension->extension->search($keyword);
        }
        return $results;
    }
365787
static public function fetchTagsByKeyword( $keyword, $language = false )
    {
        if ( $language )
        {
            if ( !is_array( $language ) )
                $language = array( $language );
            eZContentLanguage::setPrioritizedLanguages( $language );
        }

        if ( strpos( $keyword, '*' ) !== false )
        {
            $keyword = preg_replace(
                array(
                    '#%#m',
                    '#(?<!\\\\)\\*#m',
                    '#(?<!\\\\)\\\\\\*#m',
                    '#\\\\\\\\#m'
                ),
                array(
                    '\\%',
                    '%',
                    '*',
                    '\\\\'
                ),
                $keyword
            );

            $keyword = array( 'like', $keyword );
        }

        $result = eZTagsObject::fetchByKeyword( $keyword );

        if ( $language )
            eZContentLanguage::clearPrioritizedLanguages();

        if ( is_array( $result ) && !empty( $result ) )
            return array( 'result' => $result );

        return array( 'result' => false );
    }
1161970
private function findSynonym(KeywordInterface $keyword)
    {
        return $this->keywordRepository->findByKeyword($keyword->getKeyword(), $keyword->getLocale());
    }
658142
public function keySearch($key)
    {
        foreach (array_keys($this->data) as $k) {
            if (!strcasecmp($k, $key)) {
                return $k;
            }
        }

        return false;
    }
630626
protected function globalSearch($keyword)
    {
        $this->query->where(function ($query) use ($keyword) {
            collect($this->request->searchableColumnIndex())
                ->map(function ($index) {
                    return $this->getColumnName($index);
                })
                ->reject(function ($column) {
                    return $this->isBlacklisted($column) && ! $this->hasFilterColumn($column);
                })
                ->each(function ($column) use ($keyword, $query) {
                    if ($this->hasFilterColumn($column)) {
                        $this->applyFilterColumn($query, $column, $keyword, 'or');
                    } else {
                        $this->compileQuerySearch($query, $column, $keyword);
                    }

                    $this->isFilterApplied = true;
                });
        });
    }
860512
public function get($keyword)
        {
            $results = $this->socialNetwork->get($keyword);

            $results = $this->sentimentAnalytics->analyze($results);

            return $results;
        }
305251
public function suggestTags($keyword,$limit=20)
	{
		$tags=$this->findAll(array(
			'condition'=>'name LIKE :keyword',
			'order'=>'frequency DESC, Name',
			'limit'=>$limit,
			'params'=>array(
				':keyword'=>'%'.strtr($keyword,array('%'=>'\%', '_'=>'\_', '\\'=>'\\\\')).'%',
			),
		));
		$names=array();
		foreach($tags as $tag)
			$names[]=$tag->name;
		return $names;
	}
982031
public function getKeyword($keyword, $lang = null)
    {
        $parts = $this->_callInternalLocale('getKeywords', null, $lang, false);
        return isset($parts[$keyword]) ? $parts[$keyword] : null;
    }
427950
public function addToLastSearches($keywords)
    {
        $mode = $this->configuration->getSearchLastSearchesMode();
        switch ($mode) {
            case 'user':
                $this->storeKeywordsToSession($keywords);
                break;
            case 'global':
                $this->lastSearchesRepository->add($keywords, (int)$this->configuration->getSearchLastSearchesLimit());
                break;
            default:
                throw new \UnexpectedValueException(
                    'Unknown mode for plugin.tx_solr.search.lastSearches.mode, valid modes are "user" or "global".',
                    1342456570
                );
        }
    }
426856
public function searchKeywords($keywords, $queryBuilder)
    {
        if ($this->attributeKey) {
            $result = $queryBuilder->expr()->like('ak_' . $this->attributeKey->getAttributeKeyHandle(), ':keywords');
        } else {
            $result = null;
        }

        return $result;
    }
399048
public boolean matchKeyword(String keyword) {
		return tok.ttype == StreamTokenizer.TT_WORD && tok.sval.equals(keyword)
				&& keywords.contains(tok.sval);
	}
706331
public function Browse($Keywords = '', $Page = '', $Order = '') {
      $this->View = 'index';
      $this->Index($Keywords, $Page, $Order = '');
   }
387019
public function findByKeyword($keyword)
    {
        if ($keyword !== false) {
            $data = $this->getKeywordListFromCache();

            // 如果有完全匹配,直接返回
            if (isset($data[static::EXACT_MATCH][$keyword])) {
                return $this->findByIdFromCache($data[static::EXACT_MATCH][$keyword]);
            }

            // 判断是否有部分匹配
            foreach ($data[static::PARTIAL_MATCH] as $partialKeyword => $id) {
                if (strpos($keyword, (string) $partialKeyword) !== false) {
                    return $this->findByIdFromCache($id);
                }
            }
        }

        return '';
    }
406545
public function filterByKeywords($keywords)
    {
        $expressions = [
            $this->query->expr()->like('g.gName', ':keywords'),
            $this->query->expr()->like('g.gDescription', ':keywords'),
        ];

        $expr = $this->query->expr();
        $this->query->andWhere(call_user_func_array([$expr, 'orX'], $expressions));
        $this->query->setParameter('keywords', '%' . $keywords . '%');
    }
77263
public function setKeywords(array $keywords)
    {
        // Removes old keywords
        $oldKeywords = array_filter($this->keywords->toArray(), function (Keyword $keyword) use ($keywords) {
            return !in_array($keyword, $keywords);
        });
        array_walk($oldKeywords, function (Keyword $keyword) {
            $this->removeKeyword($keyword);
        });

        // Adds new ones
        array_walk($keywords, function (Keyword $keyword) {
            $this->addKeyword($keyword);
        });
    }
833050
public function process($keyword){
        switch($keyword){
            case 'DATE_NOW':
                return strval(time());
            case 'DATE_Y4':
            case 'DATE_YEAR':
                return date('Y');
            case 'DATE_Y2':
                return date('y');
            case 'DATE_M':
            case 'DATE_MONTH':
                return date('m');
            case 'DATE_N':
                return date('n');
            case 'DATE_D':
            case 'DATE_DAY':
                return date('d');
            case 'DATE_J':
                return date('j');
            case 'DATE_H24':
            case 'DATE_HOUR':
                return date('H');
            case 'DATE_H12':
                return date('h');
            case 'DATE_I':
            case 'DATE_MINUTE':
                return date('i');
            case 'DATE_S':
            case 'DATE_SECOND':
                return date('s');
            case 'DATE_U':
            case 'DATE_MSEC':
                $t = microtime(true);
                return sprintf("%06d",($t - floor($t)) * 1000000);
        }
        return NULL;
    }
566266
private static function removeKeyword($clause, $keyword)
    {
        $keyword .= ' ';
        if (stristr(substr($clause, 0, strlen($keyword)), $keyword) !== false) {
            return substr($clause, strlen($keyword));
        }

        return $clause;
    }