'Generates a list of params to use when searching.'

def build_params(self, spelling_query=None):

    kwargs = {u'start_offset': self.start_offset}
    if self.order_by:
        kwargs[u'sort_by'] = self.order_by
    if (self.end_offset is not None):
        kwargs[u'end_offset'] = self.end_offset
    if self.highlight:
        kwargs[u'highlight'] = self.highlight
    if self.facets:
        kwargs[u'facets'] = self.facets
    if self.date_facets:
        kwargs[u'date_facets'] = self.date_facets
    if self.query_facets:
        kwargs[u'query_facets'] = self.query_facets
    if self.narrow_queries:
        kwargs[u'narrow_queries'] = self.narrow_queries
    if spelling_query:
        kwargs[u'spelling_query'] = spelling_query
    elif self.spelling_query:
        kwargs[u'spelling_query'] = self.spelling_query
    if self.boost:
        kwargs[u'boost'] = self.boost
    if self.within:
        kwargs[u'within'] = self.within
    if self.dwithin:
        kwargs[u'dwithin'] = self.dwithin
    if self.distance_point:
        kwargs[u'distance_point'] = self.distance_point
    if self.result_class:
        kwargs[u'result_class'] = self.result_class
    if self.fields:
        kwargs[u'fields'] = self.fields
    if self.models:
        kwargs[u'models'] = self.models
    return kwargs
