def detail(self, group_hash, keyword, sort): sort_field, sort_method, group_method = SORT_MODES[sort] ql = sphinxql.search(self.index, 'json') ql.keyword(keyword + ' ' + group_hash).sort( '%s %s' % (sort_field, sort_method)).limit(0, 1000) result = ql.run(self.SPHINX_HOST) return result
def query(self, keyword, sort, start, count): sort_field, sort_method, group_method = SORT_MODES[sort] ql = sphinxql.search(self.index, 'json', '%s(%s) AS sort_by' % (group_method, sort_field)) ql.keyword(keyword).sort('sort_by %s' % sort_method).group('group_hash').limit( start, count) result = ql.run(self.SPHINX_HOST) return result
def detail(self, group_hash, keyword, sort): sort_field, sort_method, group_method = SORT_MODES[sort] ql = sphinxql.search(self.index, 'json') ql.keyword(keyword+' '+group_hash).sort('%s %s'%(sort_field, sort_method)).limit(0, 1000) result = ql.run(self.SPHINX_HOST) return result
def query(self, keyword, sort, start, count): sort_field, sort_method, group_method = SORT_MODES[sort] ql = sphinxql.search(self.index, 'json', '%s(%s) AS sort_by'%(group_method, sort_field)) ql.keyword(keyword).sort('sort_by %s'%sort_method).group('group_hash').limit(start, count) result = ql.run(self.SPHINX_HOST) return result