예제 #1
0
파일: apis.py 프로젝트: running-fish/818717
 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
예제 #2
0
파일: apis.py 프로젝트: running-fish/818717
 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
예제 #3
0
파일: apis.py 프로젝트: running-fish/818717
 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
예제 #4
0
파일: apis.py 프로젝트: running-fish/818717
 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