# Path: dopplr/basequery.py
# class BaseQuery(object):
#     """
#     Base class for all query implementations.
#     """
# 
#     def get_params(self):
#         """
#         Return the actual params for the query.
#         """
#         raise NotImplemented
# 
# Path: dopplr/solr/query/query.py
# class FilterQuery(BaseQuery):
#     """
#     A `FilterQuery`.
#     """
# 
#     def __init__(self, query, tag=None):
#         """
#         Set the query value.
#         """
#         self.__query = query
#         self.__tag = tag
# 
#     def get_params(self):
#         """
#         Return the list of query params.
#         """
#         if self.__tag:
#             return [('fq', '{!tag=%s}%s' % (self.__tag, self.__query))]
#         return [('fq', self.__query)]


from dopplr.basequery import BaseQuery
from dopplr.solr.query.query import FilterQuery
        self.__field = field
        self.__value = value
        self.__tag = tag

        self.__optional_params = {
            'prefix': prefix,
            'sort': sort,
            'limit': limit,
            'offset': offset,
            'mincount': mincount,
            'missing': missing,
            'method': method,
            'enum.cache.minDf': minDf
        }

    def get_params(self):
        """
        Return the list of query params.
        """
        params = []
        params.append(('facet', 'true'))
        params.append(('facet.field', self.__field))

        for p in self.__optional_params:
            if self.__optional_params[p]:
                params.append(('f.%s.facet.%s' % (self.__field, p),
                    str(self.__optional_params[p])))

        if self.__value:
            if self.__tag:

# Path: dopplr/basequery.py
# class BaseQuery(object):
#     """
#     Base class for all query implementations.
#     """
# 
#     def get_params(self):
#         """
#         Return the actual params for the query.
#         """
#         raise NotImplemented
# 
# Path: dopplr/solr/query/query.py
# class FilterQuery(BaseQuery):
#     """
#     A `FilterQuery`.
#     """
# 
#     def __init__(self, query, tag=None):
#         """
#         Set the query value.
#         """
#         self.__query = query
#         self.__tag = tag
# 
#     def get_params(self):
#         """
#         Return the list of query params.
#         """
#         if self.__tag:
#             return [('fq', '{!tag=%s}%s' % (self.__tag, self.__query))]
#         return [('fq', self.__query)]


# Path: dopplr/solr/query/facets.py
from dopplr.basequery import BaseQuery
from dopplr.solr.query.query import FilterQuery

        self.__field = field
        self.__value = value
        self.__tag = tag

        self.__optional_params = {
            'prefix': prefix,
            'sort': sort,
            'limit': limit,
            'offset': offset,
            'mincount': mincount,
            'missing': missing,
            'method': method,
            'enum.cache.minDf': minDf
        }

    def get_params(self):
        """
        Return the list of query params.
        """
        params = []
        params.append(('facet', 'true'))
        params.append(('facet.field', self.__field))

        for p in self.__optional_params:
            if self.__optional_params[p]:
                params.append(('f.%s.facet.%s' % (self.__field, p),
                    str(self.__optional_params[p])))

        if self.__value:
            if self.__tag:

                params.extend(FilterQuery(