示例#1
0
文件: base.py 项目: ejesse/elasticosm
 def filter(cls, *args, **kwargs):
     type_name = cls.__get_elastic_type_name__()
     from elasticosm.models.queryset import Query, QuerySet
     query = Query.from_query_args(kwargs)
     query.elastic_type = type_name
     qs = QuerySet(query=query)
     return qs
示例#2
0
    def get(type_name, query_args):

        from elasticosm.models.queryset import Query, QuerySet
        query = Query.from_query_args(query_args)
        if type_name is not None:
            query.elastic_type = type_name

        return QuerySet(query=query)
示例#3
0
文件: base.py 项目: ejesse/elasticosm
 def search(cls, search_term, **kwargs):
     type_name = cls.__get_elastic_type_name__()
     from elasticosm.models.queryset import Query, QuerySet
     query_args = kwargs
     query_args['search_term'] = search_term
     query = Query.from_query_args(query_args)
     query.elastic_type = type_name
     qs = QuerySet(query=query)
     return qs