return a query set searching for the query string q
            either implement this method yourself or set the search_field
            in the LookupChannel class definition
505105
def get_query(self, q, request):
        
        return Group.objects.filter(
            Q(name__icontains=q)
            | Q(description__icontains=q)
        )
240173
def get_queryset(self):
        
        queryset    = super(IndexView, self).get_queryset()
        search_form = self.get_search_form()

        if search_form.is_valid():
            query_str   = search_form.cleaned_data.get('q', '').strip()
            queryset    = self.model.objects.search(query_str)

        return queryset
251658
def get_queryset(self):
        
        qs = super(MultilingualManager, self).get_queryset()
        if isinstance(qs, MultilingualQuerySet):
            # Is already patched by MultilingualQuerysetManager - in most of the cases
            # when custom managers use super() properly in get_queryset.
            return qs
        return self._patch_queryset(qs)
267738
def search(self, query):
        
        logger.info("Catalog query={}".format(query))

        # Support to set the catalog as a request parameter
        catalogs = _.to_list(req.get("catalog", None))
        if catalogs:
            return senaiteapi.search(query, catalog=catalogs)
        # Delegate to the search API of Bika LIMS
        return senaiteapi.search(query)
69909
def find(self, *args, **kwargs):
    " "
    return Query(*args, db=self, schema=self.schema)
558834
def query_string(context, **kwargs):
    """"""
    params = context["request"].GET.copy()

    for key, value in list(kwargs.items()):
        params[key] = value

    return "?" + params.urlencode()
1242837
def search(query)
      get('/v1/search'.freeze, { q: query })
    rescue => e
      logger.warn "API v1 - Search failed #{e.backtrace}"
      { 'results' => catalog(query) }
    end
361264
def search(query, data, replacements=None):
    """"""
    query = q.Query(query, params=replacements)
    for entry in data:
        if solve.solve(query, entry).value:
            yield entry
257491
def get_queryset_filters(self, query):
        
        conditions = Q()
        for field_name in self.fields:
            conditions |= Q(**{
                self._construct_qs_filter(field_name): query
            })
        return conditions
1000778
def basic_search(self, pattern):
        
        lookup = None
        for pattern in pattern.split():
            query_part = models.Q()
            for field in SEARCH_FIELDS:
                query_part |= models.Q(**{'%s__icontains' % field: pattern})
            if lookup is None:
                lookup = query_part
            else:
                lookup |= query_part

        return self.get_queryset().filter(lookup)
1291068
def query(self):
        """"""
        if self._query is None:
            query_string = self.environ.get('QUERY_STRING')
            self._query = QueryDict([
                (k.decode('utf-8'), v.decode('utf-8'))
                for k, v in urlparse.parse_qsl(
                    query_string, keep_blank_values=True)
            ])
        return self._query
1222351
def query(self, query_str, *query_args, **query_options):
        
        with self.connection(**query_options) as connection:
            query_options['connection'] = connection
            return self._query(query_str, query_args, **query_options)
1374273
def querystring(self):
        
        return {key: value for (key, value) in self.qs.items()
                if key.startswith(self.MANAGED_KEYS) or self._get_key_values('filter[')}
631277
def get_queryset(self):
        
        if router.is_sf_database(self.db):
            q = models_sql_query.SalesforceQuery(self.model, where=compiler.SalesforceWhereNode)
            return query.SalesforceQuerySet(self.model, query=q, using=self.db)
        return super(SalesforceManager, self).get_queryset()
973253
def search(self, query=None, **kwargs):
        ""
        api_path = "/api/v2/search.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if query:
            api_query.update({
                "query": query,
            })
        return self.call(api_path, query=api_query, **kwargs)
238284
def GET(self):
        
        if self._GET is None:
            data = parse_qs(self.query_string, keep_blank_values=True)
            self._GET = MultiDict()
            for key, values in data.iteritems():
                for value in values:
                    self._GET[key] = value
        return self._GET
655763
def query(options, collection_name,
          num_to_skip, num_to_return, query, field_selector=None):
    
    data = struct.pack("<I", options)
    data += bson._make_c_string(collection_name)
    data += struct.pack("<i", num_to_skip)
    data += struct.pack("<i", num_to_return)
    data += bson.BSON.encode(query)
    if field_selector is not None:
        data += bson.BSON.encode(field_selector)
    return __pack_message(2004, data)