'Search for documents based on type filters, search_text or order_by and return a queryset of document objects
:param types: list of Document2 types (e.g. - query-hive, directory, etc)
:param search_text: text to search on in the name and description fields
:param order_by: order by field (e.g. -last_modified, type)'

def search_documents(self, types=None, search_text=None, order_by=None):

    documents = self
    if (types and isinstance(types, list)):
        documents = documents.filter(type__in=types)
    if search_text:
        documents = documents.filter((((Q(uuid__icontains=search_text) | Q(name__icontains=search_text)) | Q(description__icontains=search_text)) | Q(search__icontains=search_text)))
    if order_by:
        documents = documents.order_by(order_by)
    return documents
