Allura/allura/lib/search.py
def site_admin_search(model, q, field, **kw):
    """Performs SOLR search for a given model.

    Raises SearchError if SOLR returns an error.
    """
    # first, grab an object and get the fields that it indexes
    obj = model.query.find().first()
    if obj is None:
        return  # if there are no objects, we won't find anything
    fields = obj.index()
    if field == '__custom__':
        # custom query -> query as is
        q = obj.translate_query(q, fields)
    else:
        # construct query for a specific selected field
        q = obj.translate_query(u'%s:%s' % (field, q), fields)
    fq = [u'type_s:%s' % model.type_s]
    return search(q, fq=fq, ignore_errors=False, **kw)
Performs SOLR search for a given model.

    Raises SearchError if SOLR returns an error.
    
Performs SOLR search for a given model.
Raises SearchError if SOLR returns an error.
Performs SOLR search for a given model . Raises SearchError if SOLR returns an error .
def site_admin_search(model, q, field, **kw):
    obj = model.query.find().first()
    if obj is None:
        return  
    fields = obj.index()
    if field == '__custom__':
        q = obj.translate_query(q, fields)
    else:
        q = obj.translate_query(u'%s:%s' % (field, q), fields)
    fq = [u'type_s:%s' % model.type_s]
    return search(q, fq=fq, ignore_errors=False, **kw)
def site_admin_search ( model , q , field , ** kw ) : obj = model . query . find ( ) . first ( ) if obj is None : return fields = obj . index ( ) if field == '__custom__' : q = obj . translate_query ( q , fields ) else : q = obj . translate_query ( u'%s:%s' % ( field , q ) , fields ) fq = [ u'type_s:%s' % model . type_s ] return search ( q , fq = fq , ignore_errors = False , ** kw )
Performs SOLR search for a given model.
Performs SOLR search for a given model .
"""Performs SOLR search for a given model.

    Raises SearchError if SOLR returns an error.
    """ # first, grab an object and get the fields that it indexes # if there are no objects, we won't find anything # custom query -> query as is # construct query for a specific selected field
model
q
field