Beispiel #1
0
 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()
Beispiel #2
0
 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
Beispiel #3
0
 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
Beispiel #4
0
 def uniq(self):
     """A canonical / unique string representation of this query.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
Beispiel #5
0
 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)))
Beispiel #6
0
 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 uniq(self):
     """A canonical / unique string representation of this query.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
Beispiel #8
0
 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)))