Filters by "keywords" (which searches everything including filenames, title, tags, users who uploaded the file, tags).
328740
public function filterByKeywords($keywords, $simple = false)
    {
        $db = Loader::db();
        $kw = $db->quote($keywords);
        $qk = $db->quote('%' . $keywords . '%');

        $keys = CollectionAttributeKey::getSearchableIndexedList();
        $attribsStr = '';
        foreach ($keys as $ak) {
            $cnt = $ak->getController();
            $attribsStr .= ' OR ' . $cnt->searchKeywords($keywords);
        }

        if ($simple || $this->indexModeSimple) {
            $this->filter(false, "(psi.cName like $qk or psi.cDescription like $qk or psi.content like $qk {$attribsStr})");
        } else {
            $this->indexedSearch = true;
            $this->indexedKeywords = $keywords;
            $this->autoSortColumns[] = 'cIndexScore';
            $this->filter(false, "((match(psi.cName, psi.cDescription, psi.content) against ({$kw})) {$attribsStr})");
        }
    }
1301066
def search(self, term):
        
        r = requests.get(self.apiurl + "/users", params={"filter[name]": term}, headers=self.header)

        if r.status_code != 200:
            raise ServerError

        jsd = r.json()

        if jsd['meta']['count']:
            return SearchWrapper(jsd['data'], jsd['links']['next'] if 'next' in jsd['links'] else None, self.header)
        else:
            return None
669922
def peopleFilters(self, request, tag):
        
        filters = iter(self.organizer.getPeopleFilters())
        # at some point we might actually want to look at what filter is
        # yielded first, and filter the person list accordingly.  we're just
        # going to assume it's the "All" filter, and leave the person list
        # untouched for now.
        yield tag.onePattern('selected-filter').fillSlots(
            'name', filters.next().filterName)
        pattern = tag.patternGenerator('filter')
        for filter in filters:
            yield pattern.fillSlots('name', filter.filterName)
1113071
def search(context, keywords, module, raw, kind):
    
    logging.info(_('Entering search mode'))
    sense = context.obj['sense']
    func = sense.query_names if module else sense.query_info
    none = True
    for keyword in keywords:
        output = func(keyword, raw, kind)
        if output:
            none = False
            print(output)
        else:
            logging.warning(_('No results: %s'), keyword)
    sys.exit(1 if none else 0)
476032
def search(self, keyword):
        ''''''
        if type(keyword) != unicode: q = keyword.decode('utf-8')
        req = self.fetch(self.search_url, {'q':q.encode('gbk')})
        if not req: return None
        html = req.content.decode('gbk').encode('utf-8')
        soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES, markupMassage=hexentityMassage)
        cats = self.cats_parser(soup)
        keywords = self.keywords_parser(soup)
        mall_items = self.mall_items_parser(soup)
        total = int(soup.find('div', attrs={'class':'user-easy'}).find('a').string)
        lists = self.lists_parser(soup)
        ads = self.ads_parser(soup)
        return SearchResults(keyword, total, lists, mall_items, ads, cats, keywords)
499242
function _defferedSearch() {
        if (_findBar && _findBar._options.multifile && !_findBar._options.replace) {
            _findBar.redoInstantSearch();
        }
    }
242957
function findAll(tags, key) {
  return tags
    .filter(function(tag) {
      return tag && tag.type === key
    })
    .map(function(tag) {
      return tag.string
    })
}
1181751
def findall(self, title=None):
        
        if title is None:
            return list(self)
        files = backend.iterfiles(self._drive, name=title)
        return [self[id] for id, _ in files]
1174955
def get_filter(filetypes, ext):
    """"""
    if not ext:
        return ALL_FILTER
    for title, ftypes in filetypes:
        if ext in ftypes:
            return _create_filter(title, ftypes)
    else:
        return ''
526917
def search_tags(self, tag_name):

        

        response = self._req('/browse/tags/search', {
            "tag_name":tag_name
        })

        tags = list()

        for item in response['results']:
            tags.append(item['tag_name'])

        return tags
619039
def search(self, keyword):
        
        params = {
            "source": "map",
            "description": keyword
        }
        data = self._request(ENDPOINTS['SEARCH'], params)
        data['result_data'] = [res for res in data['result_data'] if isinstance(res, dict)]
        return data
288641
def filter_archives(ctx, prefix, pattern, engine):
    '''
    
    '''

    _generate_api(ctx)

    # want to achieve behavior like click.echo(' '.join(matches))

    for i, match in enumerate(ctx.obj.api.filter(
            pattern, engine, prefix=prefix)):

        click.echo(match, nl=False)
        print('')
354753
def query_all():
        '''
        
        '''
        recs = TabPost2Tag.select(
            TabPost2Tag,
            TabTag.kind.alias('tag_kind'),
        ).join(
            TabTag,
            on=(TabPost2Tag.tag_id == TabTag.uid)
        )
        return recs
1023275
def filter(self, *args, **kwargs):
		""""""
		if 'pk' in kwargs or 'id' in kwargs:
			return self.all_with_deleted().filter(*args, **kwargs)
		return self.get_query_set().filter(*args, **kwargs)
1159885
def search(self):
        ""
        form = forms.HomeForm()
        bbm_filter = bs_filters.BookmarkBukuFilter(
            all_keywords=False, deep=form.deep.data, regex=form.regex.data)
        op_text = bbm_filter.operation()
        values_combi = sorted(itertools.product([True, False], repeat=3))
        for idx, (all_keywords, deep, regex) in enumerate(values_combi):
            if deep == form.deep.data and regex == form.regex.data and not all_keywords:
                choosen_idx = idx
        url_op_text = op_text.replace(', ', '_').replace('  ', ' ').replace(' ', '_')
        key = ''.join(['flt', str(choosen_idx), '_buku_', url_op_text])
        kwargs = {key: form.keyword.data}
        url = url_for('bookmark.index_view', **kwargs)
        return redirect(url)
429020
def filter_event(tag, data, defaults):
    '''
    
    '''
    ret = {}
    keys = []
    use_defaults = True

    for ktag in __opts__.get('filter_events', {}):
        if tag != ktag:
            continue
        keys = __opts__['filter_events'][ktag]['keys']
        use_defaults = __opts__['filter_events'][ktag].get('use_defaults', True)

    if use_defaults is False:
        defaults = []

    # For PY3, if something like ".keys()" or ".values()" is used on a dictionary,
    # it returns a dict_view and not a list like in PY2. "defaults" should be passed
    # in with the correct data type, but don't stack-trace in case it wasn't.
    if not isinstance(defaults, list):
        defaults = list(defaults)

    defaults = list(set(defaults + keys))

    for key in defaults:
        if key in data:
            ret[key] = data[key]

    return ret
404920
def _search(self, search_terms, begins_with=None):
        

        kwargs = dict(
            ProjectionExpression='#id',
            ExpressionAttributeNames={"#id": "_id"})

        if len(search_terms) > 0:
            kwargs['FilterExpression'] = reduce(
                lambda x, y: x & y,
                [Attr('tags').contains(arg) for arg in search_terms])

        if begins_with:
            if 'FilterExpression' in kwargs:
                kwargs['FilterExpression'] = kwargs[
                    'FilterExpression'] & Key('_id').begins_with(begins_with)

            else:
                kwargs['FilterExpression'] = Key(
                    '_id').begins_with(begins_with)

        while True:
            res = self._table.scan(**kwargs)
            for r in res['Items']:
                yield r['_id']
            if 'LastEvaluatedKey' in res:
                kwargs['ExclusiveStartKey'] = res['LastEvaluatedKey']
            else:
                break