def __init__(self, status, field, term, user_sph_map={}): self.status = status self.term = utils.strips(term) field = field.strip().lower() self.user_field = utils.dictreverse(user_sph_map).get(field, field).lower() self.sph_field = user_sph_map.get(field, field).lower()
def sphinx(self): """The string representation of this query which should be sent to sphinx. """ s = utils.strips(' '.join(qt.sphinx for qt in self)) if not s and not self.ALLOW_EMPTY: s = ' ' return s
def uniq(self): """A canonical / unique string representation of this query. """ return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
def uniq(self): """A canonical / unique string representation of this query. SQLCache will look for this variable when caching the query results. """ return utils.strips(' '.join(qt.uniq for qt in sorted(self)))